Here is my problem. I searched a lot iframe cross-browser to resize code, and I just can't find it. Everything I saw has problems in one browser over another. That's what I'm doing. I am loading an iframe on a page in an overlay of jquery tools. This iframe will load the contents of the page (in the same domain, so no need to worry about the cross domain). When the user clicks on the action in this form, the iframe will need to be resized again (it works for me when the iframe grows, but not when the iframe decreases).
I have a js file that is included in an iframe that has this function
$(window).load(function(){ parent.adjust_iframe(); });
This function then calls the parent page functions as follows:
function adjust_iframe() { //i have tried both body and html and both dont work in IE var h = $("#overlayFrame").contents().find("body").height(); if(h==0) h="500"; else h=h+3; $("#overlayFrame").css({'height': h}); window.scrollTo(0,0); }
The above code works fine in Chrome and firefox, but not in IE.
Any help here? I really need a cross browser, a lightweight compatible solution that is not related to some kind of heavy jquery plugin that is not supported.
Thanks!
source share