Forum Moderators: open
<HTML>
<HEAD>
<TITLE>FRAMES</TITLE>
<SCRIPT language=Javascript>
var tims = Null;
</script>
</HEAD>
<BODY BGCOLOR="000000" BORDER="0">
<DIV HALIGN="center">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD WIDTH="100%">
<IMG BORDER="0" SRC="scroll_up.gif" WIDTH="16" HEIGHT="32"></TD>
</TR>
<TR>
<TD WIDTH="100%">
<IMG BORDER="0" SRC="scroll.gif" WIDTH="16" HEIGHT="28"></TD>
</TR>
<!-- "javascript:parent.MainFrame.scrollBy(0,100)" -->
<!-- onMouseOut="clearTimeout(window.top.timer);" -->
<!-- onMouseOver="window.top.timer=window.top.setTimeout(javascript:parent.MainFrame.scrollBy(0,100), 200);" -->
<TR>
<TD WIDTH="100%">
<IMG BORDER="0" SRC="scroll_down.gif" WIDTH="16" HEIGHT="33" onMouseOver="window.top.tims=setTimeout('parent.MainFrame.scrollBy(0,100)', 2);"></TD>
</TR>
</TABLE>
</DIV>
</BODY>
well from the above code i'm trying to scroll one of my pages by just moving over an image, but i want it to continue scrolling when i'm there so i thought lets use SetTimeOut and when i move from the image lets use ClearTimeOut but it gives me errors can anybody help me to fix it.
it still works when i move the mouse from the image back again just not when i leave it there.
I sore something like this on EA's web site in battlefield 1942. So i'm trying to do that well a version anyways.
i've taken out ClearTimeOut for the moment.
thanks the pig
I will change it to setInterval when I get home from college
setTimeout('parent.MainFrame.scrollBy(0,100)', 2);"
Am I calling SetTimeout correct?
and defining the Variable to hold the ID for setTimeout/setInterval?
The code 'parent.MainFrame.scrollBy(0,100)' in setTimeout is this how i call it as this give me an error also?
thanks the pig
Now, you don't have to define the variable tims (
var tims = Null;). Besides, if you want to do that the correct syntax is var tims = null; with null lowercase. Second, you can change the onmouseover to this:
onmouseover="tims=setInterval('parent.MainFrame.scrollBy(0,100)', 10);" onmouseout="clearInterval(tims);" That should work.
Good effect? Yes, it's very "nifty" ..
However, nifty things like these will not work if the user is using keyboard only to surf your page. Nor will it be useful to those with disabilities that have to rely on screen readers, head wands, and other tools to surf the Internet.
Anyway, still a nice effect.