I am trying to do the flying cart which means when ever Add to cart button is clicked, the product image should be taken as clone and fly into the basket. The same as this video
The video has the code as
$("button").on("click",function(){
$(this).closest("li")
.find("img")
.clone()
.addClass("zoom")
.appendTo("body");
setTimeout(function(){
$(".zoom").remove();
},1000);
});
The same I should do in javascript / html without Jquery.
My trying
var itm1 = document.getElementById("one");
// HEre I can take the clone of the image.
var cln1 = itm1.cloneNode(true);
// Here I need to add the css to this image as per the video.