一个报表块,js设置自动滚动,刷新整个页面没有任何问题,一切正常,如果点击页面内查询,这个报表块的滚动速度越来越快,js看的不是特别懂,请教一下应该把哪一块修改一下
js代码:
setInterval(function() {
var center = $('.frozen-center');
var north = $('.frozen-north');
var west = $('.frozen-west');
west.css('overflow-x', 'hidden');
center.css('overflow-x', 'hidden');
north.css('overflow-y', 'hidden');
center.css('overflow-y', 'hidden');
}, 100);
window.flag = true;
//鼠标悬停,滚动停止
setTimeout(function() {
$("#frozen-center").mouseover(function() {
window.flag = false;
});
//鼠标离开,继续滚动
$("#frozen-center").mouseleave(function() {
window.flag = true;
});
var old = -1;
var interval = setInterval(function() {
if (window.flag) {
if(".fr-btn-text"){
}
currentpos = $("#frozen-center").scrollTop;
if (currentpos == old) {
$("#frozen-center").scrollTop = 0;
} else {
old = currentpos;
//以25ms的速度每次滚动1.5PX
$("#frozen-center").scrollTop = currentpos + 1.5;
}
}
}, 35);
}, 1000);