Home Forums WoodMart support forum Popup triggers

Popup triggers

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #691293

    la.xtemos.acc
    Participant

    Hello!

    We are testing now the new popups (https://xtemos.com/docs-topic/popup-builder/) and would like to know how to trigger those popups on a button click?

    We have a custom code for the elementors popups via Dashboard -> Templates -> Popups (see attached file)
    But since popups that are created using Dashboard -> Popups belong to wd_popups and not pure elementor popups, there should be a method of the theme how to trigger the popups properly.

    Could you please advise how to correctly trigger those type of the popups to appear on the button click?

    #691294

    la.xtemos.acc
    Participant

    Here is the .js custom code

    #691296

    la.xtemos.acc
    Participant

    Here is the custom code used for Elementor popups

    jQuery(window).on(‘elementor/frontend/init’, function () {
    var button = document.querySelector(‘.contactformpopuptest’);
    if (button) {
    button.addEventListener(‘click’, function (e) {
    e.preventDefault();

    if (
    typeof elementorProFrontend !== ‘undefined’ &&
    elementorProFrontend.modules &&
    typeof elementorProFrontend.modules.popup !== ‘undefined’
    ) {
    console.log(‘Popup module loaded:’, elementorProFrontend.modules.popup);
    try {
    elementorProFrontend.modules.popup.showPopup({ id: 29063 }); // ID of the elementor popup
    } catch (err) {
    console.error(‘Popup failed to open:’, err);
    }
    } else {
    console.warn(‘Popup module is not available. Make sure Elementor Pro is active and the popup is published.’);
    }
    });
    }
    });

    #691352

    Artem Temos
    Keymaster

    Hello,

    To trigger the pop-up when you click on a specific button, you don’t need to use custom JavaScript code. Simply remove the code and use the “On selector click” trigger as shown in the screenshot https://gyazo.com/bd73ac3b12aee6185ba18c93d5a77ecc
    In this case, your button should have a CSS class of my-custom-button.

    Kind Regards

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)