Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function() {
  2.     var observer = new MutationObserver(function(mutations) {
  3.         mutations.forEach(function(mutationRecord) {
  4.             $.cookie("popup_clicked", true, { expires: 365, path: "/" });
  5.             $(".whatsapp-not-vizited").hide();
  6.             $(".popup-vizited").show();        
  7.         });    
  8.     });
  9.  
  10.     var target = document.getElementsByClassName("mailpoet_validate_success");
  11.     observer.observe(target[0], { attributes : true, attributeFilter : ["style"] });   
  12.  
  13.     if ($.cookie("popup_closed")) {
  14.         $(".popup-not-vizited").hide();
  15.     }
  16.  
  17.     if ($.cookie("popup_clicked")) {
  18.         $("popup-not-vizited").hide();
  19.         $(".popup-vizited").show();
  20.     }
  21.  
  22.     $(".close-popup-btn").on("click", function(e) {
  23.         var now = new Date();
  24.         now.setTime(now.getTime() + 1 * 3600 * 1000);
  25.         document.cookie = "popup_closed=true; expires=" + now.toUTCString() + "; path=/";
  26.     }) 
  27. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement