What is an event?

Events are certain moments in the plugin execution time, such as when the plugin is loaded.

The load event

The load event is triggered when the element is loaded, and all the images are fully visible and loaded in the browser cache if there are any.

To add a function to the load event, we will use the following event handler:

$('.reveal').on('reveal.load', function (event) {
  console.log('Reveal has been loaded.')
});

The show event

The show event occurs when an element becomes visible. This event works well with repeating animations.

To add a function to the show event, we will use the following event handler.

$('.reveal').on('reveal.show', function (event) {
  console.log('Element is now visible.');
});

The hide event

The hide event occurs when an element becomes hidden. This event works well with repeating animations.

To add a function to the hide event, we will use the following event handler.

$('.reveal').on('reveal.hide', function (event) {
  console.log('Element is now hidden.');
});

Read Next
Methods