Commit 8a860f8ac91c6b0d4ec239a0fba4b574dfa5450d

Authored by Alex Savenko
1 parent fb17d6f4

hiding popup

Showing 1 changed file with 22 additions and 17 deletions   Show diff stats
src/app/frontend/views/page/index.php
... ... @@ -337,32 +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   - this.parentEl.parentEl.style.display = 'hide';
350   - $(".delivery-form-par").show();
351   - $(".delivery-form-par").animate({opacity: "1"}, 500, function() {});
352   - $(".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() {});
353 358 });
354   - $(".delivery-form-par .close-white").click(function(){
355   - $(".delivery-form-par .popup-main-delivery").animate({opacity: "0",top: "-50%"}, 300, function() {});
356   - $(".delivery-form-par").animate({opacity: "0"}, 500, function() {});
357   - 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);
358 363 });
359   - $(".delivery-form-par .close-popup").click(function(){
360   - $(".delivery-form-par .popup-main-delivery").animate({opacity: "0",top: "-50%"}, 300, function() {});
361   - $(".delivery-form-par").animate({opacity: "0"}, 500, function() {});
362   - 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);
363 368 });
364 369 $(".modal_close").click(function(){
365   - $(".open-delivery-modal").hide();
  370 + $button.hide();
366 371 });
367 372 });
368 373  
... ...