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 103
103
slidesNavigation : false ,
104
104
slidesNavPosition : 'bottom' ,
105
105
scrollBar : false ,
106
+ lazyDistance : 1 ,
106
107
107
108
//scrolling
108
109
css3 : true ,
1345
1346
var slide = destiny . find ( SLIDE_ACTIVE_SEL ) ;
1346
1347
if ( slide . length ) {
1347
1348
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
+
1348
1368
}
1349
1369
destiny . find ( 'img[data-src], video[data-src], audio[data-src]' ) . each ( function ( ) {
1350
1370
$ ( this ) . attr ( 'src' , $ ( this ) . data ( 'src' ) ) ;
You can’t perform that action at this time.
0 commit comments