Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save israelmartins96/08586cb545b316407e8e910eee576906 to your computer and use it in GitHub Desktop.
Save israelmartins96/08586cb545b316407e8e910eee576906 to your computer and use it in GitHub Desktop.
Popup Maker Open Popup with a Delay After Another Popup is Closed
/*
* Trigger a [Popup Maker] popup when another popup is closed + Delay
*
* Reference: https://docs.wppopupmaker.com/article/554-launch-a-popup-from-a-popup-or-when-a-popup-closes
*/
jQuery(document).ready(function ($) {
/**
* Popup A: The popup that you want to trigger another popup when closed.
* Popup B: The popup that delays before opening after Popup A is closed.
*
* Change "123" to your Popup A's ID number;
* Change "456" to your Popup B's ID number.
*
*/
$("#pum-123 #popmake-123 .pum-close.popmake-close").click(function(event) {
// Delays Popup B from opening
setTimeout(
() => {
// Change "456" to your popup B's ID number
PUM.open(456);
}, 60000 // Popup B opens 60 seconds after Popup A is closed; Adjust the timing as desired.
); // setTimeout
}); // click
}); // jQuery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment