美文网首页
table 自动滚动

table 自动滚动

作者: Q1an | 来源:发表于2021-12-22 14:07 被阅读0次

    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 自动滚动

          本文链接:https://www.haomeiwen.com/subject/yqpqqrtx.html