$(".dact-start").click(function(){
        timer=setInterval("showTime()", 100);
        setTimeout(function(){clearInterval(timer);$(".dact-1-2").attr("id","dact-num"+5);}, 4000)
    })
    function showTime()
        {
            var today=Math.floor(Math.random()*8+1);
            $(".dact-1-2").attr("id","dact-num"+today);
        }

点击开始执行setInterval,过一段时间执行setTimeout

相关文章:

  • 2021-07-20
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2021-06-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2021-09-15
  • 2021-12-03
  • 2022-12-23
相关资源
相似解决方案