jquery/javascript alert popup on a set time

2019-02-14 23:40发布

Do you know if there exists any Jquery plugin that displays an alert popup message every period of time, or one in a set period of time? For instance: your time expires in x minutes, the timeout being given.

Thank you!

2条回答
孤傲高冷的网名
2楼-- · 2019-02-15 00:06

Why plugin when there is a native window.setInterval javascript function?

window.setInterval(function() {
    // this will execute every 5 minutes => show the alert here
}, 300000);

Of course you could use a plugin to do sexier notifications rather than a boring alert.

查看更多
仙女界的扛把子
3楼-- · 2019-02-15 00:18

You could try jQuery.Timeout, it should do what you need!

$.timeout(5000).done(function() { 
    alert("5 seconds later..."); 
});
查看更多
登录 后发表回答