Auto Close popup
-
I have used the below code to auto-close the popup after a few seconds.
add_action( 'wp_footer', 'my_custom_popup_scripts', 500 ); /** * Add a script to automatically close a popup after X seconds. * * @since 1.0.0 * * @return void */ function my_custom_popup_scripts() { ?> <script type="text/javascript"> (function ($, document, undefined) { $('#pum-123') .on('pumAfterOpen', function () { var $popup = $(this); setTimeout(function () { $popup.popmake('close'); }, 10000); // 10 Seconds }); }(jQuery, document)) </script><?php }
How to close other popups on other pages? I have to copy/paste the same code multiple times? Can anyone please guide me?
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Auto Close popup’ is closed to new replies.