Calling a function when a scrollbar appears in an IFrame

Posted by chris on Stack Overflow See other posts from Stack Overflow or by chris
Published on 2010-04-28T11:12:15Z Indexed on 2010/04/28 11:23 UTC
Read the original article Hit count: 196

Filed under:
|
|

I got an IFrame, in the onload event i set the height of the frame:

function resizeFrame() { $("#iframeID").height($("#iframeID").contents().find("body").outerHeight(true)); }

Problem is:
When the content of the frame is increasing without a postback (javascript or Async Postback with Ajax), a scrollbar appears.
I found a solution for Firefox:

document.getElementById("iframeID").contentWindow.addEventListener("overflow", resizeFrame, false);

But i can't find a solution for IE 7+8
Anyone got an idea?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery