现在决策报表左右两边都用了同一个js,都能动,但是鼠标悬停左边列表的时候,右边也停了,然而右边不能单独停下来。怎么让两边单独控制悬停 setTimeout(function() { $("div[widgetname=REPORT0]").find("#frozen-center").css('overflow-x', 'hidden'); $("div[widgetname=REPORT0]").find("#frozen-center").css('overflow-y', 'hidden'); $("div[widgetname=REPORT0]").find("#frozen-north").css('overflow-x', 'hidden'); $("div[widgetname=REPORT0]").find("#frozen-north").css('overflow-y', 'hidden'); $("div[widgetname=REPORT0]").find(".reportContent").css('overflow-y', 'hidden'); $("div[widgetname=REPORT0]").find(".reportContent").css('overflow-x', 'hidden'); }, 100); window.flag = true; setTimeout(function() { $("#frozen-center").mouseover(function() { window.flag = false; }) //鼠标悬停,滚动停止 $("#frozen-center").mouseleave(function() { window.flag = true; }) //鼠标离开,继续滚动 var old = -1; var interval = setInterval(function() { if (window.flag) { currentpos = $("div[widgetname=REPORT0]").find("#frozen-center")[0].scrollTop; if (currentpos == old) { $("div[widgetname=REPORT0]").find("#frozen-center")[0].scrollTop = 0; } else { old = currentpos; $("div[widgetname=REPORT0]").find("#frozen-center")[0].scrollTop = currentpos + 1.5; } } }, 50); //以25ms的速度每次滚动3.5PX }, 1000) |