Skip to main content

Events

#slideshow

.on("connectionChanged", fn)

Triggered when the app’s internet connectivity status changes.

$("#slideshow").on("connectionChanged", (e, status) => {
console.log(`Connected: ${status}`);
});

#article

.on("sliderendered", fn)

Called when the slide has been rendered on the page.

$("#slideID").on("sliderendered", function (e, done) {
// Example: inject values from the context or feeds
done();
});

See also: the equivalent global event that can be registered with Bridge.Event.on()

.on("slideready", fn)

Called when the slide is the 'current' slide (the slide you're going to be looking at).

$("#slideID").on("slideready", function (e, done) {
// Example: trigger animations and add event listeners
done();
});

See also: the equivalent global event that can be registered with Bridge.Event.on()

.on("slideclosed", fn)

Alias: slide:closed

$("#slideID").on("slideclosed", function (e) {
// Example: clear timeouts and remove event listeners
});

See also: the equivalent global event that can be registered with Bridge.Event.on()

Asynchronous calls

Affects events: sliderendered, slideready

done is passed through by Bridge, declare it as an argument of the listener to use it.

Example:

$("#slideID").on("slideready", (e, done) => {
setTimeout(() => {
// The slide won't be considered ready until 'done' is called
done();
}, 1000);
});
info

done is an optional argument, do not declare it unless required.

warning

Once done is declared, it MUST be called to be resolved. Otherwise the slide will get stuck until it times out.