question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set up autoplay for Lory? Help needed

See original GitHub issue

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 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:closed
  • Created 7 years ago
  • Comments:11

github_iconTop GitHub Comments

4reactions
nstanardcommented, Oct 10, 2016

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

3reactions
katiasmetcommented, Nov 28, 2017

@nstanard Hi! It would still be great if you added this feature or example 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found