-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
67 lines (48 loc) · 1.21 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* Функциональность меню */
$(function() {
$("[data-scroll]").on("click", function(event){
event.preventDefault();
blockId = $(this).data('scroll');
blockOffset = $(blockId).offset().top;
console.log(blockOffset);
$("html, body").animate({
scrollTop: blockOffset - 50
})
});
/* Модальное окно по кнопке */
$("[data-modal]").on("click", function(event){
event.preventDefault();
$(modal_tool).addClass('show');
});
$(modal_tool).on("click", function() {
$(modal_tool).removeClass('show');
});
});
$(document).ready(function($) {
$('.button').click(function() {
$('.popup-fade').fadeIn();
return false;
});
$('.popup-close').click(function() {
$(this).parents('.popup-fade').fadeOut();
return false;
});
$(document).keydown(function(e) {
if (e.keyCode === 27) {
e.stopPropagation();
$('.popup-fade').fadeOut();
}
});
$('.popup-fade').click(function(e) {
if ($(e.target).closest('.popup').length == 0) {
$(this).fadeOut();
}
});
});
/* Тултип */
function show (elem) {
elem.style.display="block";
}
function hide (elem) {
elem.style.display="";
}