Alex Rivera | Logout

Control iframe height with jQuery

Asked 2009-06-01T10:49:23.910
20

I am using jQuery to control the height of an iframe.

jQuery("iframe",top.document).contents().height();  

This works when the height of the iframe increases. When the height decreases it does not work. It returns the old value only. Why is this happening?

Edit
Report

1 Answer

31

i use the following and it works perfectly...

$("#frameId").height($("#frameId").contents().find("html").height());

of course just when it's called (no "autoresize")... but it works increasing as decreasing

answered 2010-03-08T12:33:33.040

Your Answer