I got this from dynamic drive, and right now it makes my window scroll repeatedly. I would like to change it so that it only scrolls once... and I would love it if when I actually moved the scroll bar manually, it stopped scrolling as well. Anyone got any ideas???
<script language="JavaScript1.2">
/*
Left-Right scrolling window Script-
?Dynamic Drive (<!-- w --><a class="postlink" href="http://www.dynamicdrive.com">www.dynamicdrive.com</a><!-- w -->)
For full source code, installation instructions,
100's more free DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
//change speed to another integer to alter the scrolling speed. Greater is faster
var speed=1
var currentpos=0,alt=1,curpos1=0,curpos2=-1
function initialize(){
startit()
}
function scrollwindow(){
if (document.all)
temp=document.body.scrollLeft
else
temp=window.pageXOffset
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.scrollLeft+speed
else
currentpos=window.pageXOffset+speed
window.scroll(currentpos,0)
}
else{
currentpos=0
window.scroll(currentpos,0)
}
}
function startit(){
setInterval("scrollwindow()",10)
}
window.onload=initialize
</script>
- see an example here: <!-- m --><a class="postlink" href="http://www.dynamicdrive.com/dynamicindex8/leftscroll.htm">http://www.dynamicdrive.com/dynamicinde ... scroll.htm</a><!-- m -->
<script language="JavaScript1.2">
/*
Left-Right scrolling window Script-
?Dynamic Drive (<!-- w --><a class="postlink" href="http://www.dynamicdrive.com">www.dynamicdrive.com</a><!-- w -->)
For full source code, installation instructions,
100's more free DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
//change speed to another integer to alter the scrolling speed. Greater is faster
var speed=1
var currentpos=0,alt=1,curpos1=0,curpos2=-1
function initialize(){
startit()
}
function scrollwindow(){
if (document.all)
temp=document.body.scrollLeft
else
temp=window.pageXOffset
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.scrollLeft+speed
else
currentpos=window.pageXOffset+speed
window.scroll(currentpos,0)
}
else{
currentpos=0
window.scroll(currentpos,0)
}
}
function startit(){
setInterval("scrollwindow()",10)
}
window.onload=initialize
</script>
- see an example here: <!-- m --><a class="postlink" href="http://www.dynamicdrive.com/dynamicindex8/leftscroll.htm">http://www.dynamicdrive.com/dynamicinde ... scroll.htm</a><!-- m -->