Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var observer = new MutationObserver(function(mutations) {
- mutations.forEach(function(mutationRecord) {
- $.cookie("popup_clicked", true, { expires: 365, path: "/" });
- $(".whatsapp-not-vizited").hide();
- $(".popup-vizited").show();
- });
- });
- var target = document.getElementsByClassName("mailpoet_validate_success");
- observer.observe(target[0], { attributes : true, attributeFilter : ["style"] });
- if ($.cookie("popup_closed")) {
- $(".popup-not-vizited").hide();
- }
- if ($.cookie("popup_clicked")) {
- $("popup-not-vizited").hide();
- $(".popup-vizited").show();
- }
- $(".close-popup-btn").on("click", function(e) {
- var now = new Date();
- now.setTime(now.getTime() + 1 * 3600 * 1000);
- document.cookie = "popup_closed=true; expires=" + now.toUTCString() + "; path=/";
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement