Forum Replies Created

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

    (@rbconsult)

    So, it came back. Buttons that don’t exist on page load and are generated from javascript will not trigger the open or close of these modals.

    Here’s how I got around it. Kinda hacky, but it works.

    //Force open
    await fadeIn(‘wow-modal-overlay-4’, 500);
    await fadeIn(‘wow-modal-window-4’, 500);

    //Force close
    await fadeOut(‘wow-modal-window-4’, 500);
    await fadeOut(‘wow-modal-overlay-4’, 500);

    async function fadeIn(id, ms){
    document.getElementById(id).style.opacity = 0;
    document.getElementById(id).style.display = “block”;
    for (let i = 1; i < 100; i++) {
    await sleep(ms / 100);
    document.getElementById(id).style.opacity = (i / 100);
    }
    }

    async function fadeOut(id, ms){
    document.getElementById(id).style.opacity = 1;
    for (let i = 100; i > 1; i–) {
    await sleep(ms / 100);
    document.getElementById(id).style.opacity = (i / 100);
    }
    document.getElementById(id).style.display = “none”;
    }`

    Thread Starter rbconsult

    (@rbconsult)

    My apologies, it seems to be working now. Initially, buttons generated from an AJAX call (i.e. didn’t exist on first load) weren’t triggering the modal via a class/click event. They are now. All good. Great addon, thanks!

    Thread Starter rbconsult

    (@rbconsult)

    It appears that any newly generated buttons don’t trigger the modal. Buttons that remain on the page work fine before and after the ajax call. Buttons that are generated as a result of the ajax call will not open the modal. Any help is appreciated. Thanks.

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