File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 103103 slidesNavigation : false ,
104104 slidesNavPosition : 'bottom' ,
105105 scrollBar : false ,
106+ lazyDistance : 1 ,
106107
107108 //scrolling
108109 css3 : true ,
13481349 var slide = destiny . find ( SLIDE_ACTIVE_SEL ) ;
13491350 if ( slide . length ) {
13501351 destiny = $ ( slide ) ;
1352+
1353+ if ( destiny . length == 1 && destiny . filter ( SLIDE_SEL ) . length ) {
1354+ // Handling a single slide.
1355+ if ( options . lazyDistance ) {
1356+ var prev = destiny . prevAll ( ':lt(' + options . lazyDistance + ')' ) ;
1357+ var next = destiny . nextAll ( ':lt(' + options . lazyDistance + ')' ) ;
1358+
1359+ // Add first/last sibling when there's no next/prev.
1360+ // (does not use options.lazyDistance currently).
1361+ if ( options . loopHorizontal ) {
1362+ if ( ! next . length ) {
1363+ next = destiny . siblings ( ':first' ) ;
1364+ } else if ( ! prev . length ) {
1365+ prev = destiny . siblings ( ':last' ) ;
1366+ }
1367+ }
1368+ destiny = destiny . add ( prev ) . add ( next ) ;
1369+ }
1370+
13511371 }
13521372 destiny . find ( 'img[data-src], video[data-src], audio[data-src]' ) . each ( function ( ) {
13531373 $ ( this ) . attr ( 'src' , $ ( this ) . data ( 'src' ) ) ;
You can’t perform that action at this time.
0 commit comments