Skip to main content

Event handling

Attaching event listeners

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

popup.events.on("click", function(e){
console.log("The popup was clicked");
});
note

The names of events are case-insensitive.

Related sample: Popup. Events

Detaching event listeners

To detach events, use popup.events.detach():

popup.events.on("click", function(e){
console.log("The popup was clicked");
});

popup.events.detach("click");

Calling events

To call events, use popup.events.fire():

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

The list of events

The full list of events is available in the related API section.