Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
update code
  • Loading branch information
CB9TOIIIA authored Dec 13, 2017
1 parent a9dd48b commit 635f200
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions closemodal.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
> Код
```
jQuery(document).on('click', function() {
simplecallback.hide();
jQuery(function($){
$(document).mouseup(function (e){ // отслеживаем событие клика по веб-документу
var block = $(".simplecallback-overlayed"); // определяем элемент, к которому будем применять условия (можем указывать ID, класс либо любой другой идентификатор элемента)
if (!block.is(e.target) // проверка условия если клик был не по нашему блоку
&& block.has(e.target).length === 0) { // проверка условия если клик не по его дочерним элементам
simplecallback.hide(); // скрываем
return false;
});
}
});
});
```

### Вставьте в свой шаблон или модуль.

0 comments on commit 635f200

Please sign in to comment.