regebro / impress-console

Speaker notes for impress.js
MIT License
133 stars 32 forks source link

How to know when the step is ready #13

Closed Emyleen closed 10 years ago

Emyleen commented 10 years ago

Hello, I'm juste making a website with impress.js technology and I want to know the code that lets me know when a step is loaded, because I want call the content in ajax. Thank you for your answer!

regebro commented 10 years ago

Well, this is really a question for impress.js, but I can answer it anyway. ;-)

impress.js sends out events. It sends out the "impress:stepleave" event when you switch to the next step, and it send out "impress:stepenter" once the transition is finished, and the step is loaded.

You can look in the code of impress-console how to use this, impress-console listens to both events.