决策报表,2个报表块实现跑马灯效果后,每次提交参数滚动速度就会变快 这个问题解决后,使用解决的JS代码,一个报表块实现了,一个报表块跑马灯也不跑了,之只隐藏了进度条,不滚动了 setTimeout(function() { //隐藏报表块report的滚动条 $("div[widgetname=REPORT2]").find(".frozen-north")[0].style.overflow = "hidden"; $("div[widgetname=REPORT2]").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=REPORT2]").find(".frozen-center")[0].scrollTop; if(currentpos == old) { $("div[widgetname=REPORT2]").find(".frozen-center")[0].scrollTop = 0; } else { old = currentpos; $("div[widgetname=REPORT2]").find(".frozen-center")[0].scrollTop = currentpos + 1.5; } } }, 50); }, 1000); |