setTimeout(function() {
//隐藏报表块report的滚动条
$("div[widgetname=REPORT13]").find(".frozen-north")[0].style.overflow = "hidden";
$("div[widgetname=REPORT13]").find(".frozen-center")[0].style.overflow = "hidden";
}, 200);
window.flag = true;
//鼠标悬停,滚动停止
setTimeout(function() {
$(".frozen-center").mouseover(function() {
window.flag = false;
});
//鼠标离开,继续滚动
$(".frozen-center").mouseleave(function() {
window.flag = true;
});
var old = -1;
// 清除定时器
if(window.tag!=null){
window.clearInterval(window.tag);
}
//调用定时器
window.tag = setInterval(function() {
if(window.flag) {
currentpos = $("div[widgetname=REPORT13]").find(".frozen-center")[0].scrollTop;
if(currentpos == old) {
$("div[widgetname=REPORT13]").find(".frozen-center")[0].scrollTop = 0;
} else {
old = currentpos;
$("div[widgetname=REPORT13]").find(".frozen-center")[0].scrollTop = currentpos + 1.5;
}
}
}, 50);
}, 1000);
定时器的问题