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 ,
13451346 var slide = destiny . find ( SLIDE_ACTIVE_SEL ) ;
13461347 if ( slide . length ) {
13471348 destiny = $ ( slide ) ;
1349+
1350+ if ( destiny . length == 1 && destiny . filter ( SLIDE_SEL ) . length ) {
1351+ // Handling a single slide.
1352+ if ( options . lazyDistance ) {
1353+ var prev = destiny . prevAll ( ':lt(' + options . lazyDistance + ')' ) ;
1354+ var next = destiny . nextAll ( ':lt(' + options . lazyDistance + ')' ) ;
1355+
1356+ // Add first/last sibling when there's no next/prev.
1357+ // (does not use options.lazyDistance currently).
1358+ if ( options . loopHorizontal ) {
1359+ if ( ! next . length ) {
1360+ next = destiny . siblings ( ':first' ) ;
1361+ } else if ( ! prev . length ) {
1362+ prev = destiny . siblings ( ':last' ) ;
1363+ }
1364+ }
1365+ destiny = destiny . add ( prev ) . add ( next ) ;
1366+ }
1367+
13481368 }
13491369 destiny . find ( 'img[data-src], video[data-src], audio[data-src]' ) . each ( function ( ) {
13501370 $ ( this ) . attr ( 'src' , $ ( this ) . data ( 'src' ) ) ;
You can’t perform that action at this time.
0 commit comments