Link to home
Start Free TrialLog in
Avatar of noulouk
noulouk

asked on

IFrame scrolling

Hi Experts,

Here is my code:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Untitled Document</title>
<script type="text/javascript">
var timer_id;
function scroll_iframe(frm,inc,dir) {
  if (timer_id) clearTimeout(timer_id);
  if (window.frames[frm]) {
    if (dir == "v") window.frames[frm].scrollBy(0, inc);
    else window.frames[frm].scrollBy(inc, 0);
    timer_id = setTimeout("scroll_iframe('" + frm + "'," + inc + ",'" + dir + "')", 20);
  }
}

function stopScroll() { if (timer_id) clearTimeout(timer_id); }
</script>
</head>

<body>
some randon content
  <iframe src="file:///C:/test/sampleframecontent.htm" name="IFrame"></iframe>
<br/>
some more content
<button type="button" onclick="scroll_iframe('IFrame',1,'v');">scroll frame</button>
</body>
</html>

This works fine,  but I need to know when the scrollbar reaches the end of the document to automatically popup a message for example (this is the end).

Hope you see what I need.

Thanks in advance for your help.
ASKER CERTIFIED SOLUTION
Avatar of Zyloch
Zyloch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of noulouk
noulouk

ASKER

Perfect.