File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 159159 return this . pushStack ( $ . map ( this , function ( elem , i ) {
160160 return callback . call ( elem , i , elem ) ;
161161 } ) ) ;
162+ } ,
163+ slice : function ( ) {
164+ return this . pushStack ( slice . apply ( this , arguments ) ) ;
165+ } ,
166+ first : function ( ) {
167+ return this . eq ( 0 ) ;
168+ } ,
169+ last : function ( ) {
170+ return this . eq ( - 1 ) ;
171+ } ,
172+ eq : function ( i ) {
173+ var len = this . length ,
174+ j = + i + ( i < 0 ? len : 0 ) ;
175+
176+ return this . pushStack ( j >= 0 && j < len ? [ this [ j ] ] : [ ] ) ;
177+ } ,
178+ end : function ( ) {
179+ return this . prevObject || this . constructor ( null ) ;
162180 }
163181 }
164182
14901508// 2014-05-12 : 增加$().data(), $().removeData()方法
14911509// 2014-05-13 : 增加$().event.dispatch方法
14921510// 2014-05-14 : 增加$().CallBacks()方法
1493- // 2014-05-15 : 增加$().queue()方法
1511+ // 2014-05-15 : 增加$().queue()方法
1512+ // 2014-05-16 : 增加$().first,end,eq,last方法
You can’t perform that action at this time.
0 commit comments