table 自动滚动

2021-12-22  本文已影响0人  Q1an

1、$('.list_content:even').css('background-color','rgba(14, 148, 234, 0.2)') //:even 奇数  :odd 偶数

2. 自动滚动

  function ScrollUp2() {

    setTimeout(function(){

        var table = document.getElementById("carTrafficJamConent");

        var timer = null;

        table.scrollTop = 0;

        table.innerHTML += table.innerHTML;

        function play() {

            clearInterval(timer);

            timer = setInterval(function() {

                table.scrollTop++;

                if (table.scrollTop >= table.scrollHeight / 2) {

                    table.scrollTop = 0;

                }}, 30);

        }

        setTimeout(play, 500);

        table.onmouseover = function() {

            clearInterval(timer)

        };

        table.onmouseout = play;

        },0)

    }

上一篇下一篇

猜你喜欢

热点阅读