diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core.js b/src/core.js index 01f501d21..6dbc69eb0 100644 --- a/src/core.js +++ b/src/core.js @@ -100,6 +100,18 @@ jQuery.fn = jQuery.prototype = { return this.eq( -1 ); }, + even: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return ( i + 1 ) % 2; + } ) ); + }, + + odd: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return i % 2; + } ) ); + }, + eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); |