0

I'm building a portfolio webpage and have incorporated W3School's Bootstrap Lightbox.

What I am trying to do now is make when you click outside the image, the modal closes; similar to other lightboxes. I also want to add in navigation by using the arrow keys and escape key.

I have searched Stack Overflow and have found questions similar to what I am asking but I do not understand how to add jquery to do what I want. Other lightbox modals work fine when you click outside the box to close it, but why not here? Thank you in advance.

From Bootstrap's page:

$('#myModal').on('hidden.bs.modal', function (e) { // do something... })

What do I put in the // do something..?

  • Have you written any code where we can start from it ? – amrdruid Jan 02 '17 at 18:26
  • I have looked to this page. Let me know if this helps http://stackoverflow.com/questions/8363802/bind-a-function-to-twitter-bootstrap-modal-close?rq=1 –  Jan 02 '17 at 18:28
  • Can you put code that you have done??? because the link that is given by you is not a bootstrap. It is a CSS and written script written by W3School it self. – Shalin Patel Jan 04 '17 at 15:47

0 Answers0