标签:timer scrollto line 插件 function interval int get iss
Start:function()
{
if(this.isSmoothScroll)
{
this.AutoScrollTimer = setInterval(this.GetFunction(this,"SmoothScroll"), this.Timeout);
}
else
{
//this.AutoScrollTimer = setInterval(this.GetFunction(this,"AutoScroll"), this.Timeout);//原来的插件中,此句与AutoScroll中的递归重复,导致即使更改了speed也无效,因此在此处改为仅可执行一次的SetTimeOut
this.AutoScrollTimer = setTimeout(this.GetFunction(this, "AutoScroll"), this.Timeout);
}
},
AutoScroll:function()
{
if(this.stopscroll)
{
return;
}
this.ScrollContent.scrollTop++;
if(parseInt(this.ScrollContent.scrollTop) % this.LineHeight != 0)
{
this.ScrollTimer = setTimeout(this.GetFunction(this,"AutoScroll"), this.Speed);
}
else
{
if(parseInt(this.ScrollContent.scrollTop) >= parseInt(this.ScrollContent.scrollHeight) / 2)
{
this.ScrollContent.scrollTop = 0;
}
clearTimeout(this.ScrollTimer);
this.Start();
//this.AutoScrollTimer = setTimeout(this.GetFunction(this,"AutoScroll"), this.Timeout);
}
},
标签:timer scrollto line 插件 function interval int get iss
原文地址:https://www.cnblogs.com/DoudouZhang/p/10335350.html