JQuery and Frames
Although there is definitely some room for debate in the web development and design community on where the usage of frames is necessary, there are some situations where they cannot be avoided.
Manipulation of data within these frames can be confusing, and dumping frames to page content using ajax or server side code is not always possible. This is especially true if these pages contain their own sub-site navigation.
In these scenarios, JQuery helps us simplify content management within frames using a combination of the “.contents()” method and “find” functionality to locate and update elements.
If “videoframe” is the id of the iframe, the example below changes the background color of a body inside the frame to a specific color.
JS (JQuery):
$('#videoframe').contents().find("body").css("background-color", "#FFFFFF");
References:
JQuery API, http://api.jquery.com/contents
Posted on January 5, 2011, in Programming & Development and tagged .net, application, asp, code, dev, development, javascript, jquery, program, programming, web. Bookmark the permalink. Leave a comment.
Leave a comment
Comments 0