联动后,点击表格数据,跑马灯越跑越快,怎么解决? if (window.interval) { clearInterval(window.interval); } //判断之前是否执行过该代码,如果有,就停止之前的执行 setTimeout(function() { //隐藏报表块report0的滚动条(此报表块名为report0,根据具体情况修改) $("div[widgetname=REPORT0]").find(".frozen-north").css({ 'overflow-x': 'hidden', 'overflow-y': 'hidden' }); $("div[widgetname=REPORT0]").find(".frozen-center").css({ 'overflow-x': 'hidden', 'overflow-y': 'hidden' }); }, 2000); window.flag0 = true; var self0 = this; //鼠标悬停,滚动停止 window.tim = setTimeout(function() { $("div[widgetname=REPORT0]").find(".frozen-center").mouseover(function() { window.flag0 = false; }); //鼠标离开,继续滚动 $("div[widgetname=REPORT0]").find(".frozen-center").mouseleave(function() { window.flag0 = true; }); var old = -1; window.interval = setInterval(function() { if (!self0.isVisible()) { return; } if (window.flag0) { currentpos1 = $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop; if (currentpos1 == old && 0 != currentpos1) { $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = 0; } else { old = currentpos1; //以25ms的速度每次滚动1.5PX $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = currentpos1 + 1.5; } } }, 100); }, 5000); |