diff --git a/src/app/frontend/views/page/index.php b/src/app/frontend/views/page/index.php index eee74c8..59a18a1 100644 --- a/src/app/frontend/views/page/index.php +++ b/src/app/frontend/views/page/index.php @@ -337,32 +337,37 @@ js, fjs); else return false; return c[1] ? c[1] : false; } - var cookie = getCookie('popup'); + + var cookie = getCookie('popup'); + var $button = $(".open-delivery-modal"); + var $popup = $(".delivery-form-par"); + var $popup_inner = $popup.find(".popup-main-delivery"); + if (cookie !== '1') { - setTimeout(function(){$(".open-delivery-modal").show();},1000); + setTimeout(function(){$button.show();},1000); } else { - $(".open-delivery-modal").hide(); + $button.hide(); } - $(".open-delivery-modal div img").click(function(){ - this.parentEl.parentEl.style.display = 'hide'; - $(".delivery-form-par").show(); - $(".delivery-form-par").animate({opacity: "1"}, 500, function() {}); - $(".delivery-form-par .popup-main-delivery").animate({opacity: "1",top: "15%"}, 300, function() {}); + $button.find("div img").click(function(){ + $(this).parent().parent().hide(); + $popup.show(); + $popup.animate({opacity: "1"}, 500, function() {}); + $popup_inner.animate({opacity: "1",top: "15%"}, 300, function() {}); }); - $(".delivery-form-par .close-white").click(function(){ - $(".delivery-form-par .popup-main-delivery").animate({opacity: "0",top: "-50%"}, 300, function() {}); - $(".delivery-form-par").animate({opacity: "0"}, 500, function() {}); - setTimeout(function(){$(".delivery-form-par").hide();}, 600); + $popup.find("close-white").click(function(){ + $popup_inner.animate({opacity: "0",top: "-50%"}, 300, function() {}); + $popup.animate({opacity: "0"}, 500, function() {}); + setTimeout(function(){$popup.hide();}, 600); }); - $(".delivery-form-par .close-popup").click(function(){ - $(".delivery-form-par .popup-main-delivery").animate({opacity: "0",top: "-50%"}, 300, function() {}); - $(".delivery-form-par").animate({opacity: "0"}, 500, function() {}); - setTimeout(function(){$(".delivery-form-par").hide();}, 600); + $popup.find("close-popup").click(function(){ + $popup_inner.animate({opacity: "0",top: "-50%"}, 300, function() {}); + $popup.animate({opacity: "0"}, 500, function() {}); + setTimeout(function(){$popup.hide();}, 600); }); $(".modal_close").click(function(){ - $(".open-delivery-modal").hide(); + $button.hide(); }); }); -- libgit2 0.21.4