SanSYS

Untitled

Jun 13th, 2015
5,320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery.fn.extend({
  2.     hover: function( fnOver, fnOut ) {
  3.         return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  4.     },
  5.  
  6.     bind: function( types, data, fn ) {
  7.         return this.on( types, null, data, fn );
  8.     },
  9.     unbind: function( types, fn ) {
  10.         return this.off( types, null, fn );
  11.     },
  12.  
  13.     delegate: function( selector, types, data, fn ) {
  14.         return this.on( types, selector, data, fn );
  15.     },
  16.     undelegate: function( selector, types, fn ) {
  17.         // ( namespace ) or ( selector, types [, fn] )
  18.         return arguments.length === 1 ?
  19.             this.off( selector, "**" ) :
  20.             this.off( types, selector || "**", fn );
  21.     }
  22. });
Advertisement
Add Comment
Please, Sign In to add comment