表格每隔2秒上滚一个单元格.
代码:
- <div class="blockcode"><blockquote>setTimeout(function() {
- $("div[widgetname=REPORT0]").find(".reportContent")[0].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")[0].scrollTop;
- if(currentpos == old) {
- if ((tmp - 1) % length === 0) {
- $(".reportContent")[0].scrollTop = 0;
- clearInterval(flag);
- }
- } else {
- old = currentpos;
- $(".reportContent")[0].scrollTop = currentpos + 1;
- }
- },min)
- setTimeout(function aa() {
- clearInterval(flag);
- }, 1000)
- },autoTime);
- },2000)
- },2000);
复制代码
在表格完成时添加此js即可 事件-添加事件-初始化后 编辑于 2019-8-28 14:52
编辑于 2019-8-28 14:53
|