Skip to main content
All CollectionsAdvancedJavascript
Before-popup-display Event
Before-popup-display Event
Updated over 2 months ago

The before-popup-display event is fired before the display of a popup, bar, or embed. This is one of the various events Wisepops can trigger as part of our JS callbacks feature.
โ€‹

Prevent popup display

The display of the popup can be prevented by calling preventDefault() on the event:

wisepops('listen', 'before-popup-display', function(event) {
event.preventDefault();
});

Event target

The targeted element (event.target) is the popup HTML element, with the class wisepops-popup. If you need to interact with elements rendered inside the popup, you should retrieve them with event.target.querySelector().

Did this answer your question?