Friday, 22 May 2015

Working with CSS with parent elements and iframe elements

Apply CSS to Parent elements within iframe


parent.$('#Wrapper').find('iframe').attr('style','height:800px !important')


where,
parent will be of the iframe contents i.e. parent page
#wrapper will be id of an element in parent page which contains iframe element.

Please note:- iframe element will be the parent page element.

Apply CSS to ifram elements within parent page


$('iframe').contents().find("body").html("Iframe content overwitten")

So, here we have to first get the iframe element so that we can get its contents and then any element can by find.

Similary you can easily work with CSS to and fro with them.

No comments:

Post a Comment