Forum Discussion
Elapsed Time when the user is active on the page - help with Javascript code
The closest I can ever get:
activeTime: Start when the timeline starts on the first slide. Can be inherited to other slides. Relatively easy.
slideActiveTime: Same code as above. Triggered by "variable slideChanged is True". Set it True when timeline starts on every slide. Then it will reset to 0 when you change slides.
This is where my problem begins: Ideally, say, if I spent 10 seconds on the first slide, when I go back later, it should resume counting from 10, but the way I coded won't allow so. Even with use localStorage().
- edit: maybe 1) adding the event listener to the specific slide element rather than the entire window 2) Then adding scripts to every slide to listen corresponding elements will be able to do that. That is beyond my availability to check.