决策报表的报表块加了两段JS 第一段是初始化后隐藏滚动条并滚动 setTimeout(function() { //隐藏报表块report0_c的滚动条(此报表块名为report0_c,根据具体情况修改) $("div[widgetname=REPORT0]").find(".frozen-north")[0].style.overflow = "hidden"; $("div[widgetname=REPORT0]").find(".frozen-center")[0].style.overflow = "hidden"; }, 100); window.flag2 = true; //鼠标悬停,滚动停止 setTimeout(function() { $("div[widgetname=REPORT0]").find(".frozen-center").mouseover(function() { window.flag2 = false; }); //鼠标离开,继续滚动 $("div[widgetname=REPORT0]").find(".frozen-center").mouseleave(function() { window.flag2 = true; }); var old = -1; var interval = setInterval(function() { if(window.flag2) { currentpos2 = $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop; if(currentpos2 == old) { $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = 0; } else { old = currentpos2; //以25ms的速度每次滚动1.5PX $("div[widgetname=REPORT0]").find(".frozen-center")[0].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[widgetname=REPORT0]").find(".frozen-north")[0].style.overflow = "hidden"; $("div[widgetname=REPORT0]").find(".frozen-center")[0].style.overflow = "hidden"; }, 100); window.flag2 = true; //鼠标悬停,滚动停止 setTimeout(function() { $("div[widgetname=REPORT0]").find(".frozen-center").mouseover(function() { window.flag2 = false; }); //鼠标离开,继续滚动 $("div[widgetname=REPORT0]").find(".frozen-center").mouseleave(function() { window.flag2 = true; }); var old = -1; var interval = setInterval(function() { if(window.flag2) { currentpos2 = $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop; if(currentpos2 == old) { $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = 0; } else { old = currentpos2; //以25ms的速度每次滚动1.5PX $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = currentpos2 + 1.5; } } }, 25); }, 1000); }, 5000); 然后预览的效果是,在刚打开的时候是这样的 出现定时刷新一遍之后,滚动的速度加快了,每刷新一遍就会快一点,最后就飞快了 不知道为什么,手足无措,求助大神们 ┭┮﹏┭┮ |