File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ var version = '1.3';
20
20
21
21
var locationPath = filterPath ( location . pathname ) ;
22
22
23
- $ . fn . extend ( {
24
- scrollable : function ( ) {
23
+ function getScrollable ( els ) {
25
24
var scrollable = [ ] , scrolled = false ;
25
+
26
26
this . each ( function ( ) {
27
27
28
28
if ( this == document || this == window ) { return ; }
@@ -42,10 +42,20 @@ $.fn.extend({
42
42
43
43
} ) ;
44
44
45
- return this . pushStack ( scrollable ) ;
45
+ if ( els === 'first' && scrollable . length ) {
46
+ scrollable = [ scrollable . shift ( ) ] ;
47
+ }
48
+
49
+ return scrollable ;
50
+ }
51
+ $ . fn . extend ( {
52
+ scrollable : function ( ) {
53
+ var scrl = getScrollable . call ( this ) ;
54
+ return this . pushStack ( scrl ) ;
46
55
} ,
47
56
firstScrollable : function ( ) {
48
- return this . scrollable ( ) . eq ( 0 ) ;
57
+ var scrl = getScrollable . call ( this , 'first' ) ;
58
+ return this . pushStack ( scrl ) ;
49
59
} ,
50
60
51
61
smoothScroll : function ( options ) {
You can’t perform that action at this time.
0 commit comments