-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbox.js
More file actions
23 lines (22 loc) · 678 Bytes
/
box.js
File metadata and controls
23 lines (22 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
jQuery(document).ready(function() {
jQuery(document).on('click', function(event) {
var target = jQuery(event.target);
if (target.hasClass('modal-window-trigger') || target.parents('.hidden-modal').length) {
jQuery('.hidden-modal').each(function(i, val) {
var main_index;
jQuery('.modal-window-trigger').each(function(i, val) {
if (event.target == val) {
main_index = i;
}
});
if (target.hasClass('modal-window-trigger')) {
var modal = jQuery('.hidden-modal').get(main_index);
var $modal = jQuery(modal);
$modal.fadeIn();
}
});
} else {
jQuery('.hidden-modal').fadeOut();
}
});
});