Forked from waltermesser/automatically-close-popup.php
Last active
April 14, 2017 07:04
-
-
Save danieliser/3dcfaac664be8975fea6d2fb3f201bbb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_footer', 'my_custom_popup_scripts', 500 ); | |
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment