• Resolved nandugan

    (@nandugan)


    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)
  • Maria T

    (@mariatogonon)

    Hi @nandugan – thanks for reaching out.

    If you want to enter multiple ID’s then you can simply edit the popup IDs to be like this?$(‘#pum-123, #pum-124, #pum-124′)’.

    Could you please try that and let us know if that works for you?

    If that helps, then we would very much appreciate it if you could quickly?rate the plugin, just to help us spread the word.

    Otherwise, for us to assist you further with your issue, you will need to escalate it directly to our HelpScout support desk. Check out this link:?https://wppopupmaker.com/support/?Thank you.

    Thread Starter nandugan

    (@nandugan)

    Worked perfectly, Thanks.

    Maria T

    (@mariatogonon)

    That’s awesome! Thanks for letting us know and you are welcome @nandugan! ??

    By the way if you have time, we would very much appreciate it if you could quickly?rate the plugin, just to help us spread the word.

    Have a great weekend! Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Auto Close popup’ is closed to new replies.