决策报表的报表块加了两段JS第一段是初始化后隐藏滚动条并滚动setTimeout(function() {
//隐藏报表块report0_c的滚动条(此报表块名为report0_c,根据具体情况修改)
$("div").find(".frozen-north").style.overflow = "hidden";
$("div").find(".frozen-center").style.overflow = "hidden";
}, 100);
window.flag2 = true;
//鼠标悬停,滚动停止
setTimeout(function() {
$("div").find(".frozen-center").mouseover(function() {
window.flag2 = false;
});
//鼠标离开,继续滚动
$("div").find(".frozen-center").mouseleave(function() {
window.flag2 = true;
});
var old = -1;
var interval = setInterval(function() {
if(window.flag2) {
currentpos2 = $("div").find(".frozen-center").scrollTop;
if(currentpos2 == old) {
$("div").find(".frozen-center").scrollTop = 0;
} else {
old = currentpos2;
//以25ms的速度每次滚动1.5PX
$("div").find(".frozen-center").scrollTop = currentpos2 + 1.5;
}
}
}, 25);
}, 1000);第二段是初始化后事件,定时刷新后隐藏滚动条并滚动var form = this.options.form;
setInterval(function() {
form.getWidgetByName('report0').gotoPage(1, "{}", true);//报表块刷新
$(".loading-ec-indicator").eq(0).remove();//移除刷新加载图片
$(".text-indicator").remove();//移除正在加载文字
setTimeout(function() {
//隐藏报表块report0_c的滚动条(此报表块名为report0_c,根据具体情况修改)
$("div").find(".frozen-north").style.overflow = "hidden";
$("div").find(".frozen-center").style.overflow = "hidden";
}, 100);
window.flag2 = true;
//鼠标悬停,滚动停止
setTimeout(function() {
$("div").find(".frozen-center").mouseover(function() {
window.flag2 = false;
});
//鼠标离开,继续滚动
$("div").find(".frozen-center").mouseleave(function() {
window.flag2 = true;
});
var old = -1;
var interval = setInterval(function() {
if(window.flag2) {
currentpos2 = $("div").find(".frozen-center").scrollTop;
if(currentpos2 == old) {
$("div").find(".frozen-center").scrollTop = 0;
} else {
old = currentpos2;
//以25ms的速度每次滚动1.5PX
$("div").find(".frozen-center").scrollTop = currentpos2 + 1.5;
}
}
}, 25);
}, 1000);
}, 5000);然后预览的效果是,在刚打开的时候是这样的出现定时刷新一遍之后,滚动的速度加快了,每刷新一遍就会快一点,最后就飞快了不知道为什么,手足无措,求助大神们 ┭┮﹏┭┮