2

I am using impress.js library to make a presentation. I would like to attach a listener for a div where if the slide has classes present active. Then, I would like to have a counter to be displayed on the slide. I tried to use elem.addEventListener('change',function(){counter()},false), but it didn't work.

I would like to know if there is a way to attach an event to impress:next function.

Sincerely, Abdul

abdul
  • 134
  • 1
  • 11

1 Answers1

3

You can add a listener which will be executed on current step :

document.addEventListener("impress:starttransition", function (event) {
    yourFunction(event.detail.next.id); });

document.addEventListener("impress:stepenter", function (event) {
    yourFunction(event.target.id); });
Grey Li
  • 11,664
  • 4
  • 54
  • 64
Rey0bs
  • 1,192
  • 12
  • 19