多报表块滚动,报表块名称需要大写,报表块需要设置冻结,每个报表块可以拷贝代码,但是注意修改报表块名
setTimeout(function() {
//隐藏报表块REPORT0的滚动条(此报表块名为REPORT0,根据具体情况修改)
$("div[widgetname=REPORT0]").find(".frozen-north")[0].style.overflow = "hidden";
$("div[widgetname=REPORT0]").find(".frozen-center")[0].style.overflow = "hidden";
}, 1000);
window.flag = true;
//鼠标悬停,滚动停止 ,根据报表块控制,注意报表块名称大小写
setTimeout(function() {
$(".frozen-center.REPORT0table tr").mouseover(function() {
window.flag = false;
});
//鼠标离开,继续滚动
$(".frozen-center.REPORT0table tr").mouseleave(function() {
window.flag = true;
});
var old = -1;
var interval = setInterval(function() {
if(window.flag) {
currentpos = $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop;
if(currentpos == old) {
$("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = 0;
} else {
old = currentpos;
//以25ms的速度每次滚动1.5PX
$("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = currentpos + 1.5;
}
}
}, 25);
}, 1000);