Created
September 29, 2015 16:29
-
-
Save ibndawood/eb32ce36a8956620b9eb to your computer and use it in GitHub Desktop.
Prevent scrolling to top
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('body').on('added_to_cart', function(){ | |
$('.product-item').unblock(); // Unblock the product item | |
$('.cart-item').unblock(); | |
$('.compare-list').unblock(); | |
$('html,body').animate({ | |
scrollTop: $('.top-cart-holder').offset().top - 20 | |
}, 1000, function(){ | |
$('.top-cart-holder .dropdown-toggle').dropdown('toggle'); | |
}); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment