jquery.showhideevents.js 371 B

123456789101112131415
  1. /**
  2. * Adds events to jQuery's show and hide functions.
  3. *
  4. * http://viralpatel.net/blogs/jquery-trigger-custom-event-show-hide-element/
  5. */
  6. ( function( $ ) {
  7. $.each( [ 'show', 'hide' ], function( i, ev ) {
  8. var el = $.fn[ ev ];
  9. $.fn[ ev ] = function() {
  10. var result = el.apply( this, arguments );
  11. this.trigger( ev );
  12. return result;
  13. };
  14. } );
  15. } )( jQuery );