• FANTASTIC PLUGIN!

    I have some links on my site which open a fullscreen popup form and they have progressive fallback in case the user does not have javascript. They might look like

    <a href="/contact/#fsconsultation">Get a consultation</a>

    The #fsconsultation bit is what tells the page to launch the popup with id fsconsultation

    When your plugin is installed and activated, these links ignore my script to launch the popup and instead navigate to /contact/ on the site using the transition. I would like to be able to list selectors for exclusion in your plugin so my script can execute.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter James Revillini

    (@jrevillini)

    I peeked at the JS for this plugin and I noted that you are attaching the click handlers at the link level. My suggestion is to alter this a bit to connect the event listener on the document level. This allows for more flexibility in attaching/removing/blocking event listeners and should improve overall efficiency.

    Since my links that trigger popups also have the class .fstrigger , I’ll use this to disable AnimatePress on these links.

    Thread Starter James Revillini

    (@jrevillini)

    In case anyone else needs to remove AnimatePress handling from certain elements, here’s one way (which may not work for your case, but it’s a start):

    <script>
    // REMOVE ANIMATEPRESS FROM FULLSCREEN POPS
    document.addEventListener('DOMContentLoaded', () => {

    setTimeout(function () {
    // replace with whatever selector(s) works for you
    document.querySelectorAll('.fstrigger').forEach(el => {
    el.replaceWith(el.cloneNode(true));
    });
    }, 750);


    });
    </script>
    Plugin Author animatepress

    (@animatepress)

    Hello and thank you for your message.
    I’ve taken note of all your comments and I’d like to thank you for your contribution. I’m looking into applying them as soon as possible and will release an update for the plugin soon based on your suggestions.
    Thanks again and see you soon!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[feature request] exclude links by selector’ is closed to new replies.