Commit fcbfdc861d9edcb1e5c8a5419568cdc9c047e3b6
Merge branch 'popup' of gitlab.artweb.com.ua:Alex/semena
Showing
1 changed file
with
22 additions
and
16 deletions
Show diff stats
src/app/frontend/views/page/index.php
... | ... | @@ -337,31 +337,37 @@ js, fjs); |
337 | 337 | else return false; |
338 | 338 | return c[1] ? c[1] : false; |
339 | 339 | } |
340 | - var cookie = getCookie('popup'); | |
340 | + | |
341 | + var cookie = getCookie('popup'); | |
342 | + var $button = $(".open-delivery-modal"); | |
343 | + var $popup = $(".delivery-form-par"); | |
344 | + var $popup_inner = $popup.find(".popup-main-delivery"); | |
345 | + | |
341 | 346 | if (cookie !== '1') { |
342 | - setTimeout(function(){$(".open-delivery-modal").show();},1000); | |
347 | + setTimeout(function(){$button.show();},1000); | |
343 | 348 | } |
344 | 349 | else { |
345 | - $(".open-delivery-modal").hide(); | |
350 | + $button.hide(); | |
346 | 351 | } |
347 | 352 | |
348 | - $(".open-delivery-modal div img").click(function(){ | |
349 | - $(".delivery-form-par").show(); | |
350 | - $(".delivery-form-par").animate({opacity: "1"}, 500, function() {}); | |
351 | - $(".delivery-form-par .popup-main-delivery").animate({opacity: "1",top: "15%"}, 300, function() {}); | |
353 | + $button.find("div img").click(function(){ | |
354 | + $(this).parent().parent().hide(); | |
355 | + $popup.show(); | |
356 | + $popup.animate({opacity: "1"}, 500, function() {}); | |
357 | + $popup_inner.animate({opacity: "1",top: "15%"}, 300, function() {}); | |
352 | 358 | }); |
353 | - $(".delivery-form-par .close-white").click(function(){ | |
354 | - $(".delivery-form-par .popup-main-delivery").animate({opacity: "0",top: "-50%"}, 300, function() {}); | |
355 | - $(".delivery-form-par").animate({opacity: "0"}, 500, function() {}); | |
356 | - setTimeout(function(){$(".delivery-form-par").hide();}, 600); | |
359 | + $popup.find(".close-white").click(function(){ | |
360 | + $popup_inner.animate({opacity: "0",top: "-50%"}, 300, function() {}); | |
361 | + $popup.animate({opacity: "0"}, 500, function() {}); | |
362 | + setTimeout(function(){$popup.hide();}, 600); | |
357 | 363 | }); |
358 | - $(".delivery-form-par .close-popup").click(function(){ | |
359 | - $(".delivery-form-par .popup-main-delivery").animate({opacity: "0",top: "-50%"}, 300, function() {}); | |
360 | - $(".delivery-form-par").animate({opacity: "0"}, 500, function() {}); | |
361 | - setTimeout(function(){$(".delivery-form-par").hide();}, 600); | |
364 | + $popup.find(".close-popup").click(function(){ | |
365 | + $popup_inner.animate({opacity: "0",top: "-50%"}, 300, function() {}); | |
366 | + $popup.animate({opacity: "0"}, 500, function() {}); | |
367 | + setTimeout(function(){$popup.hide();}, 600); | |
362 | 368 | }); |
363 | 369 | $(".modal_close").click(function(){ |
364 | - $(".open-delivery-modal").hide(); | |
370 | + $button.hide(); | |
365 | 371 | }); |
366 | 372 | }); |
367 | 373 | ... | ... |