From 78e4d2844f7a9711aa84685b904d4e4b2803b47a Mon Sep 17 00:00:00 2001 From: Eugeny Galkovskiy Date: Wed, 10 May 2017 13:13:07 +0300 Subject: [PATCH] уведомление о добавлении товара в корзину fixed --- frontend/web/js/script.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/web/js/script.js b/frontend/web/js/script.js index 884d85a..84b3b3a 100755 --- a/frontend/web/js/script.js +++ b/frontend/web/js/script.js @@ -111,14 +111,13 @@ $( e.preventDefault(); var id = $(this) .data('id'); - var alert_id = Math.floor(Math.random() * (999 - 100 + 1)) + 100; basket.add(id, 1); if ($('.alert-cart').length > 0) { } else { - $('body').prepend($("
Товар добавлен в корзину.
")); - setTimeout(function(){$("#alert_"+alert_id).addClass("active");},100); - setTimeout(function(){$("#alert_"+alert_id).removeClass("active");},3500); - setTimeout(function(){$("#alert_"+alert_id).remove();},3600); + $('body').prepend($("
Товар добавлен в корзину.
")); + setTimeout(function(){$(".alert-cart").addClass("active");},100); + setTimeout(function(){$(".alert-cart").removeClass("active");},3500); + setTimeout(function(){$(".alert-cart").remove();},3600); } }); -- libgit2 0.21.4