This time I will share jQuery Plugin and tutorial about Auto Open A Modal After A Specific Timeout – jQuery timeoutModal, hope it will help you in programming stack.
timeoutModal is a jQuery plugin to create a customizable, cookie-enabled modal popup that automatically reveals after a timeout you specify.
The timeout modal is dismissible, and stays dismissed for 24 hours (based on the cookies).
Ideal for session timeout warning, user idle alert and more.
How to use it:
1. Include the necessary jQuery library and jQuery cookies plugin on the web page.
2 |
integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" |
3 |
crossorigin = "anonymous" ></ script > |
2. Build the html for the timeout modal.
01 |
< div class = "timeoutPopup timeoutPopup_hidden" id = "timeoutPopup" > |
02 |
< div class = "timeoutPopup__wrapper" > |
03 |
< div class = "timeoutPopup__close" ></ div > |
04 |
< div class = "timeoutPopup__content" > |
3. That’s it. The modal will auto reveal after 10 seconds when the page is completely loaded. To override the default timeout, follow this step:
2 |
var openTimeoutPopup = new TimeoutPopup( '#timeoutPopup' , 10); |
5 |
openTimeoutPopup.init(); |
This awesome jQuery plugin is developed by Yorgigiri. For more Advanced Usages, please check the demo page or visit the official website.