Animated record deletion with jquery like mootools example

Posted by twitter on Stack Overflow See other posts from Stack Overflow or by twitter
Published on 2011-02-26T23:22:34Z Indexed on 2011/02/26 23:25 UTC
Read the original article Hit count: 182

Filed under:
|

I was reading around and saw this example from David Walsh about how to animate record deletion with mootools. Does the exact same effect exist in jquery? This is his mootools code.

window.addEvent('domready',function() {
  $$('a.delete').each(function(el) {
    el.addEvent('click',function(e) {
      e.stop();
      var parent = el.getParent('div');
      var request = new Request({
        url: 'mootools-record-delete.php',
        link: 'chain',
        method: 'get',
        data: {
          'delete': parent.get('id').replace('record-',''),
          ajax: 1
        },
        onRequest: function() {
          new Fx.Tween(parent,{
            duration:300
          }).start('background-color', '#fb6c6c');
        },
        onSuccess: function() {
          new Fx.Slide(parent,{
            duration:300,
            onComplete: function() {
              parent.dispose();
            }
          }).slideOut();
        }
      }).send();
    });
  });
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about mootools