<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>test</title>
    <script src="/jquery-3.4.1.min.js"></script>
    <script>
        var b = new Array(5000, 6000, 4000);
        $(function () {
            setSelectedItem(0);
            var selectedIndex;
            var playID;
            function setSelectedItem(index) {
                selectedIndex = index;
                clearInterval(playID);
                //自动播放
                playID = setInterval(function () {
                    var index = selectedIndex + 1;
                    
                    if (index > b.length - 1) index = 0;
                    alert(b[index]);
                    setSelectedItem(index);
                }, b[index]);
            }
        })
    </script>
</head>

<body>
</body>
</html>

  上面代码5秒后弹出50006秒后弹出60004秒后弹出4000依次循环弹出。

  后续会陆续更新其他资料,喜欢请关注哦!

  我的博客:https://www.cnblogs.com/duhaoran/

相关文章:

  • 2021-06-23
  • 2021-07-02
  • 2022-12-23
  • 2021-05-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-06
  • 2021-07-08
  • 2021-05-09
  • 2021-07-24
  • 2021-11-23
  • 2022-12-23
相关资源
相似解决方案