@@ -9,25 +9,25 @@ export const processLazyPreloader = (swiper, imageEl) => {
9
9
} ;
10
10
11
11
const unlazy = ( swiper , index ) => {
12
- const imageEl = swiper . slides [ i ] . querySelector ( 'loading="lazy"' ) ;
12
+ const imageEl = swiper . slides [ index ] . querySelector ( 'loading="lazy"' ) ;
13
13
if ( imageEl ) imageEl . removeAttribute ( 'loading' ) ;
14
14
} ;
15
15
16
16
export const preload = ( swiper ) => {
17
17
if ( ! swiper || swiper . destroyed || ! swiper . params ) return ;
18
- var amount = swiper . params . lazyPreloadPrevNext ;
18
+ let amount = swiper . params . lazyPreloadPrevNext ;
19
19
const len = swiper . slides . length ;
20
20
if ( ! len || ! amount || amount < 0 ) return ;
21
21
amount = Math . min ( amount , len ) ;
22
22
const active = swiper . activeSlide ;
23
23
if ( swiper . params . rewind ) {
24
- for ( var i = active - amount ; i <= active + amount ; i ++ ) {
24
+ for ( let i = active - amount ; i <= active + amount ; i += 1 ) {
25
25
const reali = ( ( i % len ) + len ) % len ;
26
- if ( reali != active ) unlazy ( swiper , reali ) ;
26
+ if ( reali !== active ) unlazy ( swiper , reali ) ;
27
27
}
28
28
} else {
29
- for ( var i = Math . max ( active - amount , 0 ) ; i <= Math . min ( active + amount , len - 1 ) ; i ++ ) {
30
- if ( i != active ) unlazy ( swiper , i ) ;
29
+ for ( let i = Math . max ( active - amount , 0 ) ; i <= Math . min ( active + amount , len - 1 ) ; i += 1 ) {
30
+ if ( i !== active ) unlazy ( swiper , i ) ;
31
31
}
32
32
}
33
33
} ;
0 commit comments