Skip to main content

How to hide the Drawer after a certain delay

It’s possible to hide the Drawer or Popup after a certain time period by listening to the shown event. In this example below, we’ll automatically close the Drawer after 4 seconds after it has been opened.

jQuery( document ).ready( function( $ ) {
window.CartPops.drawer.on( 'show', function() {
setTimeout(() => {
window.CartPops.drawer.hide();
}, 4000 );
} );
});