决策报表报表块滚动开启自动刷新后,鼠标悬浮不暂停setTimeout(function() {
//隐藏报表块report0的滚动条(此报表块名为report0,根据具体情况修改)
$("div").find(".frozen-north").style.overflow = "hidden";
$("div").find(".frozen-center").style.overflow = "hidden";
}, 100);
var flag = true;
//鼠标悬停,滚动停止
setTimeout(function() {
$("div").find(".frozen-center").mouseover(function() {
flag = false;
});
//鼠标离开,继续滚动
$("div").find(".frozen-center").mouseleave(function() {
flag = true;
});
var old = -1;
var interval = setInterval(function() {
if(flag) {
currentpos = $("div").find(".frozen-center").scrollTop;
if(currentpos == old) {
$("div").find(".frozen-center").scrollTop = 0;
} else {
old = currentpos;
//以25ms的速度每次滚动1.5PX
$("div").find(".frozen-center").scrollTop = currentpos + 1.5;
}
}
}, 25);
}, 1000);不自动刷新前鼠标放上去可以暂停,数据自动监测刷新后,鼠标放上去就无法暂停了