How to catach the event when lightbox is closed?

4 replies · opened Apr 14, 2018

Jjavck2Apr 14, 2018

I was developing a website which contain shopcart function.

When clicking item quick view , it will open an ajax-data-lightbox window.

I want to trigger ajax in order to modify cart quantity and items data after adding new items in cart.

Could give me any direction?

SSemicolon WebSTAFFApr 17, 2018

Hello,

You can consider using the following JS code at the bottom of the Page:


	jQuery('[data-lightbox="ajax"]').on('mfpClose', function(e) {
		// your codes
	});

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Jjavck2Apr 18, 2018

Another question, How to close the lightbox by script?
thanks~

Jjavck2Apr 27, 2018

It's works , thank you.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard