问题
Is there an event triggered when there's a page change in an ioslides presentation? I'd like to allocate some resources to display the slide, and release them when the user moves on.
回答1:
Yes, ioslides triggers slideenter
and slideleave
events on each slide. These are currently handled as strings, so you'd use Javascript like
slide.setAttribute("slideenter", "somecode();");
to execute somecode();
when the slide is entered. See also this answer: Google IO Slides Template - Javascript on each slide
来源:https://stackoverflow.com/questions/33938768/event-when-slide-is-displayed-in-ioslides