Hacking¶
A plugin are expected to implement a function register(lightbox) which will be called when passed the plugin to LightBox.Core::registerPlugin. See the full API at Core API.
A basic plugin could look like this.
LightBox.Contrib.MyExitPlugin.js¶
class MyExitPlugin {
register(lightbox) {
lightbox.addOnEndListener(this.exited.bind(this));
}
exited() {
console.log('lightbox exited');
}
}