This will probably be painfully simple, but I’m clueless. I need to modify the script below to scroll only once, then return to the top – rather than looping endlessly.
Also, I’d like to invoke it with a link rather than an onload.
Finally, the script works in every browser I’ve tried except IE 6 for Windows. No problem in Firefox or on a Mac using Safari, Opera & IE.
See any obvious glitches that would break it with win IE?
here’s the script, which I’ve pasted in the body of the frame page:
<script language=”JavaScript1.2″ type=”text/javascript”>
<!–
var speed=1
var currentpos=0,alt=1,curpos1=0,curpos2=-1
function initialize(){
startit()
}
function scrollwindow(){
if (document.all)
temp=document.body.scrollTop
else
temp=window.pageYOffset
if (alt==0)
alt=1
else
alt=0
if (alt==0)
curpos1=temp
else
curpos2=temp
if (curpos1!=curpos2){
if (document.all)
currentpos=document.body.scrollTop+speed
else
currentpos=window.pageYOffset+speed
window.scroll(0,currentpos)
}
else{
currentpos=0
window.scroll(0,currentpos)
}
}
function startit(){
setInterval(“scrollwindow()”,10)
}
window.onload=initialize
//–>
</script>
Thanks for any help,
Kelly