lity
lity copied to clipboard
Closing by clicking content
I am using data-lity to display larger detailed images. Can someone aid me in configuring the lightbox to close when clicking on the image itself, as well as continue to close by clicking the X and outside of the image? I've used it several years now, so I don't know if my current version has been updated, etc., so I have attached the css and js files. css & js.zip
Thanks ahead to time! Any help would be greatly appreciated!
The close button in the default template has a data-attribute. Use that on the image itself, preferably by creating your own template and override default.
Sorry I was hoping it would be a simply alteration of the code in the js file. We'll have to access if it is worth hiring our 3rd party developer to do it.
Thank you for your swift reply.
Regards,
Dave
From: Anton Andreasson [email protected] Sent: Saturday, August 17, 2019 2:41 AM To: jsor/lity [email protected] Cc: WNE Online [email protected]; Author [email protected] Subject: Re: [jsor/lity] Closing by clicking content (#224)
The close button in the default template has a data-attribute. Use that on the image itself, preferably by creating your own template and override default.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/jsor/lity/issues/224?email_source=notifications&email_token=AM5OZ35PDBEA64OB5O6QUXDQE6TR7A5CNFSM4IMNW6EKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4QFUIA#issuecomment-522213920, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AM5OZ33Q5DWGA5QZJXYQ3KDQE6TR7ANCNFSM4IMNW6EA.
$(document).on('lity:open', function(event, instance) { $('.lity-content').click(function () { instance.close(); }); });