MrSkippy
MrSkippy

Reputation: 348

Make a div fly into another div with jQuery

I'm making a webshop and struggling a bit with jQuery.

When someone clicks the button to add a product, I want that product to fly over to the shopping cart (animated) but I really don't know how...

Here's the html:

<div id="shopping-cart">

<div class="product">Product</div>
<div class="product">Product</div>
<div class="product">Product</div>
<div class="product">Product</div>

So the functionality of jQuery would be someting like:

$('.product').click(function() {
   $(this).flyTo('#shopping-cart');
})

Thanks!

Upvotes: 0

Views: 1563

Answers (1)

Renat Seyfetdinov
Renat Seyfetdinov

Reputation: 433

You could use a jQuery script to "fly" it to a place on screen.

See an example here.

Upvotes: 2

Related Questions