Skip to main content

Popup

These methods allow you to interact with the Popup.

note

Please keep in mind that the CartPops API is subject to change. Before updating, please check the changelog to learn what has changed and whether you can safely upgrade.

.on('show', ...)

This event fires after the clicking the add to cart button or when the Popup opens programmatically — for example with a Javascript method.

🛠 Arguments

ArgumentTypeDescription
popupobjectHolds the popup with all options and properties.

🌈 Example

jQuery(function($) {
CartPops.popup.on( 'show', function( popup ) {
// Do something here 🦄
} );
});

.on('hide', ...)

This event fires after the user dismissed the Popup via a button, by clicking the Popup overlay, by pressing the escape key, or when the Popup closes progammaticaly — for example with a Javascript method.

🛠 Arguments

ArgumentTypeDescription
popupobjectHolds the popup with all options and properties.

🌈 Example

jQuery(function($) {
CartPops.popup.on( 'hide', function( popup ) {
// Do something here 🦄
} );
});