跑马灯循环的时候很生硬要怎么处理呢 用的这个js setTimeout(function() { //隐藏报表块REPORT003_C_C的滚动条(此报表块名为REPORT003_C_C,根据具体情况修改) $("div[widgetname=REPORT3]").find(".frozen-north")[0].style.overflow = "hidden"; $("div[widgetname=REPORT3]").find(".frozen-center")[0].style.overflow = "hidden"; }, 500); window.flag1 = true; var self1 = this; //鼠标悬停,滚动停止 setTimeout(function() { $("div[widgetname=REPORT3]").find(".frozen-center").mouseover(function() { window.flag1 = false; }); //鼠标离开,继续滚动 $("div[widgetname=REPORT3]").find(".frozen-center").mouseleave(function() { window.flag1 = true; }); var old = -1; var interval = setInterval(function() { if(!self1.isVisible()){ return; } if(window.flag1) { currentpos1 = $("div[widgetname=REPORT3]").find(".frozen-center")[0].scrollTop; if(currentpos1 == old) { $("div[widgetname=REPORT3]").find(".frozen-center")[0].scrollTop = 0; } else { old = currentpos1; //以35ms的速度每次滚动1.5PX $("div[widgetname=REPORT3]").find(".frozen-center")[0].scrollTop = currentpos1 + 1; } } }, 35); }, 4000); |