首页 > 其他 > 详细

无缝滚动插件速度问题

时间:2019-01-29 19:55:52      阅读:175      评论:0      收藏:0      [点我收藏+]

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);
}
},

无缝滚动插件速度问题

原文:https://www.cnblogs.com/DoudouZhang/p/10335350.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!