Skip to content
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

How to get 'ws:slide-change' #174

Open
zphering opened this issue Jan 15, 2021 · 4 comments
Open

How to get 'ws:slide-change' #174

zphering opened this issue Jan 15, 2021 · 4 comments

Comments

@zphering
Copy link

I tried to get the slide-change-event.
Nothing happends. What goes wrong?

window.ws = new WebSlides({
             autoslide: <?php echo $config['sildeTime']*1000; ?>,
             loop: true,
             changeOnClick: true,
             showIndex: false,
         });

         document.addEventListener('ws:slide-change', function (e) {
             console.log(e);
         });

Thanks for your help!

@this-user-name
Copy link

this-user-name commented Dec 12, 2021

No answer ? I'm looking for a way to make a progress bar with number slide and total slides on slide change.

@scaraliu
Copy link

I'm also searching for the miracle events but don't know from where to get them.

@bmpf
Copy link

bmpf commented Aug 27, 2022

I was able to do it, like so :

window.ws = new WebSlides({});

if ( ws.initialised === true ) {
   window.ws.el.addEventListener('ws:slide-change', function (e) {
      callthisfunctiononchange() // call the function on change
   });
}


if (ws.currentSlideI_ === 22) {} // for example check if slide is number 22 

@scaraliu
Copy link

I was able to do it, like so :

window.ws = new WebSlides({});

if ( ws.initialised === true ) {
   window.ws.el.addEventListener('ws:slide-change', function (e) {
      callthisfunctiononchange() // call the function on change
   });
}


if (ws.currentSlideI_ === 22) {} // for example check if slide is number 22 

yes! Thx for the help.
the issue was that new Webslides was done on a ws object not as a window.ws.
Or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants