Set up autoplay for Lory? Help needed
See original GitHub issueHi, I’m trying to set up an autoplay function for Lory, but I’m a bit stuck. Is there a way to get the total number of slides out of the lory-object? At the moment I’m getting a wrong number since I’m trying to fetch the number through the DOM…
Also, I still need to figure out a check when the user clicks/hovers over (now the autoplay-function keeps on triggering).
Please help 😃
What I’ve coded this far:
let index = lory(slider).returnIndex();
let totalSlides = document.querySelector('.js_slides').childElementCount;
setInterval(function(e){
//console.log(index);
if(index < totalSlides){
lory(slider).slideTo((index += 2));
} else {
lory(slider).reset();
index = 0;
}
}, 2000);
Thanks, Teun
Issue Analytics
- State:
- Created 7 years ago
- Comments:11
Top Results From Across the Web
Set up autoplay for Lory? Help needed · Issue #436 - GitHub
Hi, I'm trying to set up an autoplay function for Lory, but I'm a bit stuck. Is there a way to get the...
Read more >Lory | Drupal.org
Install the module as usual: Visit admin/modules, and enable the Lory module. More info can be found on: http://drupal.org/documentation/install ...
Read more >Need help stopping Autoplay, have tried the fixes, still stumped
Solved: I've added an audio mp3 file to my older version of Dreamweaver MX. Works great but it autoplays everytime the page loads...
Read more >Get started with Android Auto - Google Support
Android Auto brings apps to your car display so you can focus while you drive. You can control features like navigation, maps, calls,...
Read more >Instructions to Enable Adobe Flash - Montgomery County ...
Instructions to Enable Adobe Flash. ... Video Viewing Help ... Change the Autoplay Policy to "No User Gesture Required". Click Relaunch Now to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am working right now and don’t have much time to finish the example with pause functionality. However, I suggest you fork the example and try to solve that part yourself!
The issues you mentioned can be solved with some simple math. http://codepen.io/nstanard/pen/yaKxzK?editors=0010
@nstanard Hi! It would still be great if you added this feature or example 👍