var reportarray = ;//根据实际情况设置跑马灯报表块的名称,名称大写。window.fobject = {};for (i = 0; i < reportarray.length; i++) { fobject = true;} for (i = 0; i < reportarray.length; i++) { $("div + "']").ready(function() { //function var index = i; let part; var self = '$("div + ']")'; var name = reportarray; console.log(name) setTimeout(function() { if ($('.scrollDiv').length == 0) //判断是否安装了自定义滚动条插件 { if ($("div").find(".frozen-center").length == 1) //没安装,报表块有没有设置冻结 { part = $("div").find(".frozen-center"); //设置了冻结时 $("div").find(".frozen-north").css("overflow", "hidden"); $("div").find(".frozen-north").css("overflow-y", "hidden"); } else { part = $("div").find(".reportContent"); //没设置冻结时 } } else { part = $("div").find(".scrollDiv"); //如果安装了插件,所有元素都是.scrollDiv } part.css("overflow", "hidden"); //去除滚动条 part.css("overflow-x", "hidden"); part.css("overflow-y", "hidden"); //兼容IE的去除滚动条 part.mouseover(function() { fobject = false; }); //鼠标离开,继续滚动 part.mouseleave(function() { fobject = true; }); var old = -1; setInterval(function() { if (fobject) { currentpos = part.scrollTop; if (currentpos == old) { part.scrollTop = 0; } else { old = currentpos; //以25ms的速度每次滚动1.5PX part.scrollTop = currentpos + 1.5; } } }, 25); }, 300) })}