Tuesday, 20 August 2013

Create loop scroll

Create loop scroll

I create this script for simple scroll of news , the problem for me it´s i
don´t know how i can create loop in the scroll
For example when scroll go to the end actually stop , i want the scroll
start other time , when go to the end start other time and continue all
time
My script :
function scroll_cp(id,time)
{
var div = $('#'+id);
setInterval(function(){
var pos = div.scrollTop();
div.scrollTop(pos + 2);
}, time)
}
Thank´s for the help

No comments:

Post a Comment