Menu icon Foundation
Trigger (open) clearing lightbox on AJAX success

I am struggling with this one - I am utilizing AJAX to construct my clearing lightbox and it's working just fine, but I cannot figure out how to simply trigger (open) the lightbox automatically upon response.

As you can see in the code, I am trying to access clearings 'open' method directly, but it's logging out a TypeError of 'Uncaught TypeError: Cannot read property 'closest' of undefined '.

success: function(data) {
    $("#about-photos-container").html(data);
	$(document).foundation('reflow');
	$(document).foundation('clearing', 'open');
}
            

         

clearingjavascriptAJAXReflow

I am struggling with this one - I am utilizing AJAX to construct my clearing lightbox and it's working just fine, but I cannot figure out how to simply trigger (open) the lightbox automatically upon response.

As you can see in the code, I am trying to access clearings 'open' method directly, but it's logging out a TypeError of 'Uncaught TypeError: Cannot read property 'closest' of undefined '.

success: function(data) {
    $("#about-photos-container").html(data);
	$(document).foundation('reflow');
	$(document).foundation('clearing', 'open');
}