决策报表,两个报表块需要跑马灯,report0悬浮鼠标,两个报表块都停止,report1悬浮,两个都没效果,report1滚动条也没去除 这个是js脚本report0: setTimeout(function() { //隐藏报表块REPORT0的滚动条(此报表块名为REPORT0,根据具体情况修改) $("div[widgetname=REPORT0]").find(".frozen-north")[0].style.overflow = "hidden"; $("div[widgetname=REPORT0]").find(".frozen-center")[0].style.overflow = "hidden"; }, 1000); window.flag1 = true; //鼠标悬停,滚动停止 setTimeout(function() { $(".frozen-center").mouseover(function() { window.flag1 = false; }); //鼠标离开,继续滚动 $(".frozen-center").mouseleave(function() { window.flag1 = true; }); var old = -1; var interval = setInterval(function() { if(window.flag1) { currentpos = $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop; if(currentpos == old) { $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = 0; } else { old = currentpos; //以25ms的速度每次滚动1.5PX $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = currentpos + 1.5; } } }, 25); }, 1000); report1: setTimeout(function() { //隐藏报表块REPORT1的滚动条(此报表块名为REPORT1,根据具体情况修改) $("div[widgetname=REPORT1]").find(".frozen-north")[0].style.overflow = "hidden"; $("div[widgetname=REPORT1]").find(".frozen-center")[0].style.overflow = "hidden"; }, 1000); window.flag2 = true; //鼠标悬停,滚动停止 setTimeout(function() { $(".frozen-center").mouseover(function() { window.flag2 = false; }); //鼠标离开,继续滚动 $(".frozen-center").mouseleave(function() { window.flag2 = true; }); var old = -1; var interval = setInterval(function() { if(window.flag2) { currentpos = $("div[widgetname=REPORT1]").find(".frozen-center")[0].scrollTop; if(currentpos == old) { $("div[widgetname=REPORT1]").find(".frozen-center")[0].scrollTop = 0; } else { old = currentpos; //以25ms的速度每次滚动1.5PX $("div[widgetname=REPORT1]").find(".frozen-center")[0].scrollTop = currentpos + 1.5; } } }, 25); }, 1000); |