File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 159
159
return this . pushStack ( $ . map ( this , function ( elem , i ) {
160
160
return callback . call ( elem , i , elem ) ;
161
161
} ) ) ;
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 ) ;
162
180
}
163
181
}
164
182
1490
1508
// 2014-05-12 : 增加$().data(), $().removeData()方法
1491
1509
// 2014-05-13 : 增加$().event.dispatch方法
1492
1510
// 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