Comments (5)
Essentially what I want to accomplish is to start the loop at the active slide specified.
Thx
from swiper.
Fixed. It turns out the index wasn't type cast correctly further up the chain. I recommend type casting inside the swipeTo method to catch this.
_this.swipeTo = function (index, speed, runCallbacks) {
index = parseInt(index, 10); //type cast to int
if (index > (numOfSlides-1)) return;
if (index<0 && !params.loop) return;
from swiper.
Also I had to wrap in setTimeout to prevent the loop setTimeout from executing later in the cycle.
//Adding identical setTimeout in my method call to keep in sync with the in loop conditional. Otherwise it will call before the loops version.
setTimeout(function(){
imageSwiper.swipeTo(active,0);
}, 0);
from swiper.
Yeah, had the same issue on project I am working and also wrap with setTimeout helped. Will think how to remove this timeout from script to make it work without it
from swiper.
Fixed in 1.6. Now can be used without setTimeout
from swiper.
Related Issues (20)
- Not looping smoothly with freeMode enabled
- swiper thumbs work differently depending on direction swiped.
- First image not loading initially in Swiper with dir="rtl" in Next.js HOT 1
- Virtual + loop with amount of slides less or equal to 3 leads to rendering duplicates
- maxBackfaceHiddenSlides parameter doesn't work when given less than 10 HOT 1
- `navigation-hide-on-click="true"` hides navigation when clicking nextEl/prevEl HOT 4
- Coverflow Effect Issue on new iOS Devices HOT 1
- `slidesPerView: "auto"` and virtual slides support HOT 1
- Slider backface hidden on updating the slides
- Thumbs Module not working on Strict Mode
- Can't swipe when swiper slides are clickable elements HOT 1
- react__WEBPACK_IMPORTED_MODULE_0__.createContext is not a function in Next.js 14.2.3 HOT 4
- Direction vertical, web components and it's fix HOT 1
- Ability to disable image lazy loading listeners HOT 9
- When using the horizontal mode of the scroll container, there are problems that are inconsistent with expectations. HOT 1
- swiper.slideTo(5) Jumps to Penultimate Image Instead of Last Image HOT 4
- Weird behavior of Swiper.js in Next.js 13 & 14 HOT 1
- slideTo animation gets cancelled when resizing browser window HOT 2
- Swiper appendSlide method doesn't work properly when virtual slides are enabled. (web-component) HOT 2
- Change the slide with the URL search query like hash-navigation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiper.