白色背景:收藏了图片

走马灯效果

$(function () {

    var SPEED = 3000;

    var num = $(".noticeLeftUl").children().length;

    var temp = 0;

    function Marquee() {

        temp = temp - 100;

        // 设置无限滚动

        if (temp == -((num) * 100)) {

            temp = 0;

            $(".noticeLeftUl").animate({ bottom: temp + '%' }, 1000);

            $(".noticeLeftUl").css('top', temp + '%');

        }

        else {

            $(".noticeLeftUl").animate({ top: temp + '%' }, 1000);

        }

    };

    // 初始化

    var MyMar = setInterval(Marquee, SPEED);

    // 鼠标事件,悬浮停止滚动,移开启动滚动

    $(".noticeLeftUl").hover(function () { clearInterval(MyMar) },

        function () { MyMar = setInterval(Marquee, SPEED) })

})

Pc端总结

 

 

相关文章:

  • 2021-06-09
  • 2021-08-11
  • 2021-09-28
  • 2021-12-02
  • 2021-12-19
  • 2021-07-31
  • 2022-12-23
猜你喜欢
  • 2022-02-05
  • 2022-12-23
  • 2021-11-28
  • 2021-11-28
  • 2021-12-25
  • 2022-01-29
  • 2022-01-26
相关资源
相似解决方案