How does lightbox work on images?

Hey guys,

I’m trying to figure out how to manually enable lightbox for an image that’s not part of the main content area. Looking through source of a working image example, I didn’t see anything specific like a class or rel attribute.

Magnific assets are loaded on the page. What’s an easy way to enable lightbox manually?

Thanks,
Viktor

Hi Viktor,

With our modules, we’re not using classnames or data attributes for the lightbox. We’re simply initializing it like so…

jQuery(function() {
	    jQuery('.our-class-name a').magnificPopup({
	    	    		type: 'image',
	    	    		closeOnContentClick: true,
	    	    		closeBtnInside: false
	    	});
});

I’m not sure if Magnific works with classnames, but you could give similar JS a shot. Let me know if you have any questions about that.

Justin