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';
2020
2121var locationPath = filterPath ( location . pathname ) ;
2222
23- $ . fn . extend ( {
24- scrollable : function ( ) {
23+ function getScrollable ( els ) {
2524 var scrollable = [ ] , scrolled = false ;
25+
2626 this . each ( function ( ) {
2727
2828 if ( this == document || this == window ) { return ; }
@@ -42,10 +42,20 @@ $.fn.extend({
4242
4343 } ) ;
4444
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 ) ;
4655 } ,
4756 firstScrollable : function ( ) {
48- return this . scrollable ( ) . eq ( 0 ) ;
57+ var scrl = getScrollable . call ( this , 'first' ) ;
58+ return this . pushStack ( scrl ) ;
4959 } ,
5060
5161 smoothScroll : function ( options ) {
You can’t perform that action at this time.
0 commit comments