What is the global object name controlling the popup?
-
I want to block a newsletter pop up when it is already opened with a click of the button (I have built my own code snippet for this).
What I need is a global object name controlling the popup.
This is the code I am trying to implement, and here I have this global object “mailpoetPopup” set.
Now on my website I have mailpoet pop up appear after 15 sec and on exit intent.Please advise.
Here is the code
<script> document.getElementById("subscribe-popup-trigger").addEventListener("click", function(event) { event.preventDefault(); // Prevent page reload document.getElementById("newsletter-popup").style.display = "flex"; // Show custom popup // Disable automatic MailPoet popup if (typeof mailpoetPopup !== 'undefined') { mailpoetPopup.disable = true; // Assuming 'mailpoetPopup' is the global object controlling the popup } }); document.getElementById("close-popup").addEventListener("click", function() { document.getElementById("newsletter-popup").style.display = "none"; // Close custom popup // Re-enable automatic MailPoet popup if (typeof mailpoetPopup !== 'undefined') { mailpoetPopup.disable = false; // Re-enable the automatic popup } }); // Close popup when clicking outside the content document.getElementById("newsletter-popup").addEventListener("click", function(event) { if (event.target === document.getElementById("newsletter-popup")) { document.getElementById("newsletter-popup").style.display = "none"; // Re-enable automatic MailPoet popup if (typeof mailpoetPopup !== 'undefined') { mailpoetPopup.disable = false; // Re-enable the automatic popup } } }); </script>
- You must be logged in to reply to this topic.