[*] MO: blockcart animation optimization

The animated element would not be removed upon the animation being finished. This made the site slow and unresponsive if the animated image was heavy (eg. a transparent png) and added to cart many times without reloading the page. This addition makes the animation behave as expected also when performing it multiple times.
This commit is contained in:
AntonLejon committed 2013-05-06 12:14:11 +03:00
1 parent 80b5855006
commit cb6f696dad
1 file changed
+1
+1
View File
@@ -232,6 +232,7 @@ var ajaxCart = {
.animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000) .animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000)
.fadeOut(100, function() { .fadeOut(100, function() {
ajaxCart.updateCartInformation(jsonData, addedFromProductPage); ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
$(this).remove();
}); });
} }
else else