File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed
projects/plugins/jetpack/modules/carousel Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change 1532
1532
} ) ;
1533
1533
1534
1534
swiper . on ( 'slideChange' , function ( swiper ) {
1535
- var index ;
1536
- // Swiper indexes slides from 1, plus when looping to left last slide ends up
1537
- // as 0 and looping to right first slide as total slides + 1. These are adjusted
1538
- // here to match index of carousel.slides.
1539
- if ( swiper . activeIndex === 0 ) {
1540
- index = carousel . slides . length - 1 ;
1541
- } else if ( swiper . activeIndex === carousel . slides . length + 1 ) {
1542
- index = 0 ;
1543
- } else {
1544
- index = swiper . activeIndex - 1 ;
1545
- }
1546
- selectSlideAtIndex ( index ) ;
1547
-
1535
+ selectSlideAtIndex ( swiper . realIndex ) ;
1548
1536
carousel . overlay . classList . remove ( 'jp-carousel-hide-controls' ) ;
1549
1537
} ) ;
1550
1538
You can’t perform that action at this time.
0 commit comments