lity
lity copied to clipboard
calling by id
I got my Lightbox to work like so:
<a href="#previewCompleteContainer" data-lity><span class="action_button" id="plate_preview_btn" >preview</span></a>
$(document).on('click', '#previewCompleteContainer', lity);
However I'm wondering how I would get it to call the element by id. The docs aren't clear as to how that could be accomplished. Something like.
$(document).on('click', '#mybutton', funciton(){
lity('#openmyelementbyId');
});
You always have an event.target (the clicked element) when the event bubbles up to the document body, so check that (and maybe its parent in your case) to see if you are clicking on or within a certain type of button with an ID. That’s what you’ll want to use to trigger your modal.