• Resolved apearlman

    (@apearlman)


    I have a page with a popup configured to show after 10 seconds. I am setting a cookie when the user closes the popup to prevent the popup from showing on subsequent visits. I also have a button on the page that will show a second (but identical) popup. I am using two popups because if the user closes the first popup, the button will not function (because of the cookie name).

    Is there a way to configure a popup such that it will not show automatically if a cookie is set but still allow the user to open the popup manually with a click?

    My use case is this: A user visits the page. They are presented with a popup allowing them to enter their email to subscribe to a newsletter. If they close that popup, they should still have the ability to sign up for the newsletter. (In my case via a “subscribe” button that shows the popup.)

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Damian

    (@timersys)

    Yes you can try the following. On that button instead of using a class you could use javascript like this:

    <a ahref="#button" onclick="wppopups.showPopup(123,true);">CLICK</a>

    Replace 123 with your popup ID

    Thread Starter apearlman

    (@apearlman)

    I think, to get this to work you need to stop the event from propagating. Otherwise, the popup will display and immediately disappear (if you have “Disable advanced closing methods” set to “No”). This is what I found to work:

    const thePopup = document.getElementById('my-popup');
    
    thePopup.addEventListener('click', (e) => {
        wppopups.showPopup(123,true);
        e.stopPropagation();
    });

    Thanks for your help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple configurable triggers?’ is closed to new replies.