Skip to main content

Event handling

Attaching event listeners​

You can attach event listeners with the pagination.events.on() method:

pagination.events.on("change", function(index, previousIndex){
console.log("The currently active page", index);
});
note

Event names are case-insensitive.

Related sample: Pagination. Events

Detaching event listeners​

The pagination.events.detach() method removes event listeners:

pagination.events.on("change", function(index, previousIndex){
console.log("The currently active page", index);
});

pagination.events.detach("change");

Calling events​

The pagination.events.fire() method calls an event:

pagination.events.fire("name",args);
// where args is an array of arguments

List of events​

The API section lists all Pagination events.