Appendix B: SlidePoint Module Javascript - Slidepoint Event Listener Functions You Can Add to your JavaScript Code

Slidepoint

Appendix B: SlidePoint Module Javascript

Event Listener Functions You Can Add to your JavaScript Code

These functions do not exist, but if you add these functions to your code, they have special meaning as event listeners as described:

 

function presentation_onload()
When you add this function, any code inside this function will run when the module is launched by the user, prior to the first slide coming into view (but after the DOM is loaded, and all images are loaded). Note: The presentation_onload() function will be run every time the user launches the module, regardless of whether they are launching it for the first time or resuming from a previously paused attempt.

 

function scene_begin(scene, slide)
Allows you to run code each time an effects/animation scene begins. The parameter scene is passed to the listener function, and represents the scene number (1 through 9). The parameter slide represents the slide number.

 

function scene_end(scene, slide)
Allows you to run code each time an effects/animation scene ends. The parameter scene is passed to the listener function, and represents the scene number (1 through 9). The parameter slide represents the slide number.

 

function slide_onresize()
Allows you to run code each time the slide canvas is resized (which typically will occur each time the window is resized). This may be helpful to re-position the Table of Contents.

 

function slide_onshow(slide)
Allows you to run code each time a slide is shown. This function runs for every slide (see the slide_##_onshow() function if you want to run code for a specific slide). The parameter slide is passed to the function, and represents the slide# getting shown.

 

function slide_##_onshow()
Allows you to run code inside function when a specific slide is viewed by the user. Replace ## in the function name with the number of the slide you would like the function to run for (for example, adding function slide_1_onshow() will run code inside that function when slide #1 comes into view). Inside of the slide_##_show() function you can also specify whether or not to run the effects on a slide when it comes into view by setting showEffects = false; inside the function (to run the effects at a later point when the user is viewing the slide use the playAllScenes() function). To override the slide configuration for disabling the slide navigation for a period of time, set disableNavigation = false; inside the function.