如何使用带有登录弹出窗口结尾的jquery创建一个5秒的倒数计时器? [英] How Can I create A 5 second Countdown timer with jquery that ends with a login popup?
本文介绍了如何使用带有登录弹出窗口结尾的jquery创建一个5秒的倒数计时器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将如何创建一个jQuery计时器,该计时器在链接鼠标悬停时启动,并依次显示1,2,3,4和5。然后在5弹出一个登录框?
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?
干杯。
推荐答案
怎么样:
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);
这篇关于如何使用带有登录弹出窗口结尾的jquery创建一个5秒的倒数计时器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文