Question

Hay, I'm looking for a jQuery plugin which i've seem before but can't now find it.

It animates a div and makes it look like it is being sent to another div, imagine that you click 'buy' on an item and the item appears to moved across the screen to a shopping basket.

Any ideas what it is?

Was it helpful?

Solution

Probably this would help:

var elements = {
  'div1' : { start: 10, distance: 100, duration: 1500},
  'div2' : { start: 30, distance: 600, duration: 1000}
}
$('.box').each(function (k, v) {
  var i = elements[v.id];
  $(v).css('left', i.start + 'px')
    .animate({left: (i.start + i.distance) + 'px'}, i.duration);
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top