-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoplay not infinite loop and the manual loop does not match the position #214
Comments
Hey, I'm noob too, but I have solved my problem with setInterval, and it works perfect on my project. You can try it too. const getData = () => { const carouselRef = React.useRef(null); const Loop = (currentItem) => { then just add it like here:
|
@IuriiSol solution worked for me however the Definitely fixable but worth noting. |
You can do like this const onNextStart = (currentItem, nextItem) => {
if (nextItem.index === partnerships.length - 1) { // we hit the last item, go to first item
setTimeout(() => {
carouselRef.current.goTo(0);
}, 1000); // 1000 = Your autoPlaySpeed declare in Carousel's prop
}
}; |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
hello I'm a newbie maybe this is a bug or my mistake. Can experts maybe help me? ,
I tried autoplay successfully but when in the last position it didn't experience an infinite loop, and also managed to apply the loop manually it worked, while when I slide to the initial position it should jump to the last position but can be seen in the ouput in my results this is not correct, which is at the 10th index should be the correct index 11th (last position)
{
"name": "zz-frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build && next export",
"start": "next start"
},
"dependencies": {
"axios": "^0.21.0",
"bootstrap": "^4.5.3",
"jquery": "^3.5.1",
"next": "10.0.2",
"node-sass": "^5.0.0",
"nprogress": "^0.2.0",
"popper.js": "^1.16.1",
"pure-react-carousel": "^1.27.6",
"react": "17.0.1",
"react-alice-carousel": "^2.5.1",
"react-dom": "17.0.1",
"react-elastic-carousel": "^0.9.5",
"react-hook-form": "^6.11.5",
"react-reveal": "^1.2.2",
"react-select": "^3.1.1",
"react-slick": "^0.27.13",
"react-toastify": "^6.1.0",
"slick-carousel": "^1.8.1",
"styled-components": "^5.2.1",
"swiper": "^6.6.0"
}
I have also followed the reference from here #9 (comment)
here my output
The text was updated successfully, but these errors were encountered: