Auto Open A Modal After A Specific Timeout - jQuery timeoutModal

Auto Open A Modal After A Specific Timeout - jQuery timeoutModal

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.

1. Include the necessary jQuery library and jQuery cookies plugin on the web page.

<script src="" 
<script src=""></script>

2. Build the html for the timeout modal.

<div class="timeoutPopup timeoutPopup_hidden" id="timeoutPopup">
  <div class="timeoutPopup__wrapper">
    <div class="timeoutPopup__close"></div>
    <div class="timeoutPopup__content">
      Modal Content Here

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:

// 10 seconds
var openTimeoutPopup = new TimeoutPopup('#timeoutPopup', 10);
// init

This awesome jQuery plugin is developed by Yorgigiri. For more Advanced Usages, please check the demo page or visit the official website.

  • Publication date: 17.04.2018
  • Source