Comments (5)
Hello @neoanchorite .
I made a custom autoCycle code for you, which allows that. Just replace the whole “startCycle” function with this new one below. I also commented the code so it’s easier to understand what each line does.
It has an option called “numberOfCycles” on top where you can specify how many cycles you want to see.
startCycle = function () {
// Set how many cycles you want to see
var numberOfCycles = 2;
// Helpers to determine how many cycles we've had
// and which slide is the last one.
var countCycles = 0,
lastSlide = $slide.length - 1;
rotate = setInterval(function () {
// Clear the event queue
$slide.stop(true, true);
// Determines where to slide next
var idx = index + 1 < length ? index + 1 : 0;
// Remove the active state and set a new one if option “pager” is true
if (settings.pager) {
selectTab(idx);
}
// Slide to the next slide
slideTo(idx);
// Check if we are seeing the last slide
if (idx === lastSlide) {
// If we are, then increase the count number
countCycles++;
}
// Stop after X amount of cycles
if (countCycles === numberOfCycles) {
clearInterval(rotate);
}
}, waitTime);
};
from responsiveslides.js.
Wow! That works a treat. I want to make a donation, but I can't find a button. Do you have one somewhere?
from responsiveslides.js.
Dear viljamis -- Working with v1.54 and can't seem to implement this fix from 2012. I'm just looking to stop the loop at th end of one cycle. Can you assist?
The files I have in place are responsiveslides-call.js, responsiveslides.js and responsiveslides.min.js
Thanks for any help!
from responsiveslides.js.
Hi Viljamis, same problem as mojodaddy but with v1.55. Just want to cycle 1or 2 time(s).
Couldn't you just add it to the actual code?
Thanks in advance.
from responsiveslides.js.
I used the above snippet, then modified it slightly to have my slideshow end by cycling back to the first slides, so I have a full rotation plus 1. Thanks for the update!
from responsiveslides.js.
Related Issues (20)
- Missing css for navigation
- Is there documentation explaining how to achieve the different Nav types?
- Readme out of date?
- responsiveSlides is not work my website HOT 1
- stop "auto: true" when clicking on "pager" or "nav"
- How to get current slider index HOT 1
- $slide.stop(true, true) is not a function HOT 2
- HTTPS breaks it? HOT 2
- Uncaught ReferenceError: responsiveSlides is not defined HOT 1
- Uncaught TypeError: e.size is not a function HOT 2
- Slides disappears when slider switch.
- silder not working
- Edge Issue
- getting an error
- How to import in node js
- Change Animation to fade from slide
- slide http vs https
- WCAG / ADA Compliance Issue from Malformed <UL> HTML
- Active fork ?
- Slider has stopped working
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 responsiveslides.js.