决策报表中滚屏效果,实现了滚动,但是滚动条隐藏不了,请问js语句哪里有啥问题啊 setTimeout(function() { $("div[widgetname=report41]").find("#frozen-center").css('overflow-x', 'hidden'); $("div[widgetname=report41]").find("#frozen-center").css('overflow-y', 'hidden'); $("div[widgetname=report41]").find("#frozen-north").css('overflow-x', 'hidden'); $("div[widgetname=report41]").find("#frozen-north").css('overflow-y', 'hidden'); $("div[widgetname=report41]").find(".reportContent").css('overflow-y', 'hidden'); $("div[widgetname=report41]").find(".reportContent").css('overflow-x', 'hidden'); }, 500); 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 = $("#frozen-center")[0].scrollTop; if (currentpos == old) { $("#frozen-center")[0].scrollTop = 0; } else { old = currentpos; $("#frozen-center")[0].scrollTop = currentpos + 1.5; } } }, 100); //以25ms的速度每次滚动3.5PX }, 1000) |