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].scrollB y(0, inc);
else window.frames[frm].scrollB y(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/sampl eframecont ent.htm" name="IFrame"></iframe>
<br/>
some more content
<button type="button" onclick="scroll_iframe('IF rame',1,'v ');">scrol l 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.
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].scrollB
else window.frames[frm].scrollB
timer_id = setTimeout("scroll_iframe(
}
}
function stopScroll() { if (timer_id) clearTimeout(timer_id); }
</script>
</head>
<body>
some randon content
<iframe src="file:///C:/test/sampl
<br/>
some more content
<button type="button" onclick="scroll_iframe('IF
</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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER