J
J
JefAir2016-07-14 18:04:48
css
JefAir, 2016-07-14 18:04:48

How does bootstrap modal close on background click work?

Task:
When clicking on the darkened background of the modal window in the bootstrap, perform a certain function.
Problem:
The script is also executed when clicking on the content of the modal window, but it needs to be done only on the background.

My logic went like this:

$('.fade').on('click',function(){
  console.log('Кликнули на затемненный фон');
});

where .fade is the standard bootstrap class.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valmih, 2016-07-14
@JefAir

This is the modal-backdrop element here, let's say in the Modal windows / usage section there is info.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question