话不多说,直接上代码:
setTimeout(function(){
$("div[widgetname=3-REPORT1]").find("#frozen-north")[0].style.overflow="hidden";
$("div[widgetname=3-REPORT1]").find("#frozen-center")[0].style.overflow="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=$("#frozen-center")[0].scrollTop;
if (currentpos==old){
$("#frozen-center")[0].scrollTop=0;
}
else {
old=currentpos;
$("#frozen-center")[0].scrollTop=currentpos+1.5;
}
}
},40);
},3000)
注意:里面几个需要修改的地方:
widgetname # 修改
flag # 若多flag需要修改变量名称