• Resolved Mat

    (@mrosero)


    Hi, I’m trying to use the custom JS option to show a popup only if there is a specific CSS tag attached to the body element, but I can’t figure out exactly what JS to use. I thought it would be enough with, since it says if the condition is true the popup will be shown:

    document.body.classList.contains(‘myprefix-open-class’ );

    But the pop up is shown even when the class is not present.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Dear @mrosero,

    We are sorry to hear that you are facing issues.
    May we know in which JS section you are using the above-mentioned custom JS code?
    Please let us know at your earliest convenience.

    Regards,
    Popup Builder Team

    Thread Starter Mat

    (@mrosero)

    Hi, I’m doing it under “#1 Add the code you want to run before the popup opening.”

    I’ve tried several things. The JS is obviously working, because I tried setting alerts. I also tried creating a function and calling it. The function works, but the popup shows even when the function returns false.

    Screencap: https://snipboard.io/GNKlHn.jpg

    Hey @mrosero ,

    Thanks for the screenshot and the info.

    In that case, could you send the system info file to us as well as provide with a link where we can see the issue live, if that’s possible?

    You can retrieve the mentioned sys info file from here:

    How to Retrieve the “System Information” File
    You can use https://wetransfer.com/ to send the file to us (the Get a Link option).
    Click here – https://prnt.sc/174oX-9Hspki
    Choose the Get Transfer Link option and then place the link in this thread – https://prnt.sc/_lQH0Rh20sme

    Thanks beforehand.

    Thread Starter Mat

    (@mrosero)

    I’d been working locally, but I replicated it on a staging site… however, it’s under htaccess password. Is there a way to send the information privately?

    Dear @mrosero,

    We are sorry for the late response.
    Sorry to inform but sending a privet info is against WordPress community guideline.
    May we know what seems to be the exact issue with sending a system info file here?
    We will be looking forward to hearing from you soon.

    Regards,
    Popup Builder Team

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom JS not working’ is closed to new replies.