表格定时上滚效果
表格每隔2秒上滚一个单元格.
代码:
setTimeout(function() {
$("div").find(".reportContent").style.overflow = "hidden";
}, 500);
setTimeout(function() {
var autoTime = 2000;
var height = $("#REPORT0 tr:eq(0)").height();
var length = $("#REPORT0 tr").length;
var tmp = 0;
var autoTable = setInterval(function start(){
$("#REPORT0 tr:gt("+tmp+")").css("background-color","Transparent");
$("#REPORT0 tr:lt("+tmp+")").css("background-color","Transparent");
$("#REPORT0 tr:eq("+tmp+")").css("background-color","rgba(8,35,88,0.5)");
tmp = (tmp + 1) % length;
},autoTime);
var min = 1000 / height;
var old = -1;
setTimeout(function bb() {
setInterval(function autoUp () {
var flag = setInterval(function up() {
currentpos = $(".reportContent").scrollTop;
if(currentpos == old) {
if ((tmp - 1) % length === 0) {
$(".reportContent").scrollTop = 0;
clearInterval(flag);
}
} else {
old = currentpos;
$(".reportContent").scrollTop = currentpos + 1;
}
},min)
setTimeout(function aa() {
clearInterval(flag);
}, 1000)
},autoTime);
},2000)
},2000);128055128051
在表格完成时添加此js即可 事件-添加事件-初始化后 编辑于 2019-8-28 14:52
编辑于 2019-8-28 14:53