• Resolved khanm

    (@khanm)


    Hi,

    I want to have a link/button in my pop-up (content) that when clicked on will close the popup. I am using blocks to create my pop-up content. Can I add some custom js to the link so that the pop-up can close. My popup will have two links: 1. points to a registration form. 2. says “No Thanks” and when u click on this ideally the pop-up will close.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @khanm

    Thank you for reaching out and apologies for the delay in response. Yes, you can Customize your Popup Opening and Closing with JS and CSS custom code(s).

    if you have any further questions, please let me know.

    Regards

    Thread Starter khanm

    (@khanm)

    Hi, So what is the close code that I hook up with the button?

    Thread Starter khanm

    (@khanm)

    my code as follows

    <a id="noThanksClose" class="no-thanks sgpb-popup-close-button-3" alt="Close" href="#"> No Thanks </a> 
    
    document.getElementById('noThanksClose').addEventListener("click", () => {
                
     closeFunction(); // <== please tell me function name to close popup here
    
            })

    Hello,

    To close the popup, you need to define the function and provide its name in the code. Here’s an example of how you can define the function and close the popup:

    function closePopup() {
    // Code to close the popup goes here
    // For example, you might hide the popup element or remove it from the DOM
    }

    document.getElementById(‘noThanksClose’).addEventListener(“click”, () => {
    closePopup(); // Call the closePopup function to close the popup
    });

    If you have any further questions, please let me know.

    Regards

    Plugin Support Jawad Ahmed

    (@jawada)

    Hi,

    Marking this thread as clarified. Any questions, we are always here to assist.

    Please contact us directly.
    Here’s the link https://help.popup-builder.com/en/ , you will see an option to chat with us or send us an email.

    Warm Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add Close Functionality in a link within Popup’ is closed to new replies.