How Can I create A 5 second Countdown timer with jquery that ends with a login popup?

前端 未结 3 1827
遥遥无期
遥遥无期 2020-12-13 00:34

How would i create a jquery timer that starts when a link is \'mouse-overed\', Displays a 1,2,3, 4 and 5, one after the other. Then on 5 pops up a login box?

Cheers.

3条回答
  •  轮回少年
    2020-12-13 01:02

    How about:

    var counter = 0;
    var interval = setInterval(function() {
        counter++;
        // Display 'counter' wherever you want to display it.
        if (counter == 5) {
            // Display a login box
            clearInterval(interval);
        }
    }, 1000);
    

提交回复
热议问题