Tried searching everywhere but couldn't find a solution, so here goes.
Based on the following script - http://codepen.io/ElmahdiMahmoud/pen/tEeDn
Rather than have an image that has rendered on the page to fly to the basket, how can I override this with a generic image say this for example: http://lorempixel.com/400/200/ ---- the path I will use will be to an images folder.
I have found the best solution for jQuery fly to cart effect from here - Fly to cart effect using jQuery Uses of this script is very simple like the below.
$(document).ready(function(){
$('.add-to-cart').on('click',function(){
//Scroll to top if cart icon is hidden on top
$('html, body').animate({
'scrollTop' : $(".cart_anchor").position().top
});
//Select item image and pass to the function
var itemImg = $(this).parent().find('img').eq(0);
flyToElement($(itemImg), $('.cart_anchor'));
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With