I've encountered an issue where a webpage keeps scrolling endlessly without stopping. I've attempted to terminate it by using the exit function, but unfortunately it's not working. Does anyone have a solution for this problem?
Find out more
<script>
var marginY = 0;
var destination= 0;
var speed = 10;
var scroller = null;
function initializeScroll(elementId)
{
destination= document.getElementById(elementId).offsettop;
scroller = setTimeout(function(){initializeScroll(elementId);},1);
marginY = marginY + speed;
if(marginY >= destination)
{
clearTimeout(scroller);
}
window.scroll(0,marginY);
}
</script>