This is the piece of JavaScript code that we need to run on slide enter – first slide on the Current Window as a simple ‘Execute JavaScript’ action or as part of an advanced action.
The most important concept in the JavaScript code used here is what is called ‘event listeners’. An event listener is like a sentinel that monitors a particular element and listens for specific events to occur; that is for a particular way this element is interacted with (e.g. if it’s clicked, double-clicked, right-clicked, etc.). When such an event occurs, the event listener ‘does something’; that is he executes a specific predefined chunk of code. On setup of such an event listener one can define:
Which element to monitor, including by which means the target element is to be identified For which event on that element to listen to What should happen when the specified event on the specified element is detected
Tags: Blog • capivate • execute javascript • interactive eLearning