Example

Move your mouse over the boxes:

The animation is started with regular animate() calls. The interesting code is in the hover handler:

$box.hover(function() {
  $box.pause();
}, function() {
  $box.resume();
});