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?
i use the following and it works perfectly...
of course just when it's called (no "autoresize")... but it works increasing as decreasing
At the time of loading I call this function
if I use without contents() it returns zero.
This is a simple jQuery that worked for me. Tested in iExplorer, Firefox and Crome:
I add 20 pixels just to avoid any scroll bar, but you may try a lower bound.