Posted By

omerta83 on 07/08/10


Tagged

javascript jquery


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

legacye


Using callbacks in jQuery


 / Published in: JavaScript
 

  1. function runAlertNow ()
  2. {
  3. $(this).html('I just ran this function!');
  4. }
  5.  
  6. // both of these lines do the same thing
  7. $('#test').slideUp(400, runAlertNow);
  8. $('#test').slideUp(400, function ()
  9. {
  10. $(this).html('I just ran the anonymous function!');
  11. });
  12.  

Report this snippet  

You need to login to post a comment.