Skip to content Skip to sidebar Skip to footer

Marque Like With Javascript

Hello again i found a great script that does almost what i want the problem is that its not moving on its own when the page loads can we change it to do that? The idea was to make

Solution 1:

Try window.onload around your code you want to run at page load.

window.onload = function() { ...yourcode... };


Solution 2:

You can try to wrap your code into the following way into the

windows.load=function(){//Your Code}

Since the script is loading before the document is loaded

<script type="text/javascript">
window.load = function(){
scrollStep=1

timerUp=""
timerDown=""

function toTop(id){
document.getElementById(id).scrollTop=0
}

function scrollDivDown(id){
clearTimeout(timerDown) 
document.getElementById(id).scrollTop+=scrollStep
timerDown=setTimeout("scrollDivDown('"+id+"')",10)
}

function scrollDivUp(id){
clearTimeout(timerUp)
document.getElementById(id).scrollTop-=scrollStep
timerUp=setTimeout("scrollDivUp('"+id+"')",10)
}

function toBottom(id){
document.getElementById(id).scrollTop=document.getElementById(id).scrollHeight
}

function stopMe(){
clearTimeout(timerDown) 
clearTimeout(timerUp)
}
};

</script>

Solution 3:

OK here i found a solution that worked perfect!! http://jscroller2.markusbordihn.de/


Post a Comment for "Marque Like With Javascript"