table 自动滚动

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)

    }

你可能感兴趣的:(table 自动滚动)