What I've had to do is:
$('iframe.autoheight')
.each(function(){this.style.height=(this.contentWindow.document.body.scrollHeight+40)+'px';})
.load(function(){this.style.height=(this.contentWindow.document.body.scrollHeight+40)+'px';});
in my $(function()... code
It seems that IE loads the iframe content before document ready fires, so
setting the height works, but FF loads it after, so at document ready the
height is zero and I need to set the height after the iframe loads. With
this code in FF the iframe flickers, once to height zero then to its final
height, but it works for me.
Danny
agent2026 wrote:
>
> So I had to give up on
> http://www.nabble.com/-%21jQ----But-need-help%3A-%22Object-doesn%27t-support-this-property-or-method%22-tf3413795.html
> this , and have resorted to an iframe for a unique situation. The iframe
> passes it's scrollHeight to setHeight() in the parent. setHeight(), you
> guessed it, sets the height of the iframe div to the scroll height.
> Everything works beautifully except in Netscape. The alert shows the
> height value is being passed, but nothing happens.
>
> // iframe height //
> function setHeight(h){
> if($.browser.mozilla) { $( function() { alert(h); } ); }
> $('#myFrame').height(h);
> }
>
>
> I know Netscape is barely in existence, but I'd like to fix it just the
> same. Any ideas?
>
> Adam
>
--
View this message in context:
http://www.nabble.com/Anyone-ever-heard-of-this-Netscape-bowser---%29-tf3426039.html#a9550357
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/