• Resolved morzar

    (@morzar)


    Hi peeps,

    thanks for this fantastic plugin, It’s really great and It works well.

    I’m using it in a digital branding project. A popup shows on the homepage, which people can close by clicking it.

    Because people are using a tablet, I also would like the modal to close ON SCROLL instead of ON CLICK.

    Any idea how to achieve that? I’ve not seen that feature, even in the paid plugins.

    Anyway, if I could write something in functions.php it would be great!

    Thanks again ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter morzar

    (@morzar)

    OK I found a way to do it myself, in JS:

    
    jQuery(function(){
    		jQuery( window ).scroll(function() {
    			jQuery( "#popmake-ID" ).popmake('close');
    		});
    });

    #popmake-ID being the ID of the popup you want to close on scroll.

    • This reply was modified 5 years, 10 months ago by morzar.
    Plugin Author Daniel Iser

    (@danieliser)

    @morzar – Nailed it, great initiative, wish more of our user were even brave enough to try their hand at a custom code solution before hearing from us ;).

    That said here are some improvements based on our latest API functions. Also your wrapper isn’t neccessary. The window element already exists prior to document ready which is what the wrapper jQuery(function () {}); does.

    `
    jQuery( window ).scroll(function() {
    PUM.close(ID);
    });
    `

    Hope that helps. If your issue is resolved please take a moment to rate and review the plugin or support.

    If you still need help please message us directly at https://wppopupmaker.com/support/.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Close modal on SCROLL ?’ is closed to new replies.