-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
111 lines (97 loc) · 2.41 KB
/
index.html
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="asd" class="modal">
<div class="modal__footer">
<button class="modal__close">
Закрыть
</button>
</div>
<div class="modal__content">
Контент попапчика
</div>
</div>
<a href="#qwe" class="button modal__trigger">Открыть попап2</a>
<div id="qwe" class="modal">
<div class="modal__footer">
<button class="modal__close">
Закрыть
</button>
</div>
<div class="modal__content">
Контент попапчика №2
</div>
</div>
<div id="sss" class="modal active">
<div class="modal__footer">
<button class="modal__close">
Закрыть
</button>
</div>
<div class="modal__content">
Контент попапчика №14
</div>
</div>
<div class="modal aas">
<div class="modal__footer">
<button class="modal__close">
Закрыть
</button>
</div>
<div class="modal__content">
Контент попапчика №18
</div>
</div>
<a href="#sss">хэш попап</a>
<script type="text/javascript" src="indexDev.js"></script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function(){
var modal = new Modal({
element:'#sss',
hash: '#sss',
dinamic: true,
open: function(){
console.log('open');
},
close: function(){
console.log('close');
document.querySelector('#sss').id = '';
document.querySelector('.modal.aas').id = 'sss';
},
BGclose: function(){
console.log('BGclose');
},
afterOpen: function(){
console.log('afterOpen');
},
afterClose: function(){
console.log('afterClose');
},
});
let a = new Modal({
element:'#asd',
modalStyle:{
'top':'50%',
'max-height':'30vh'
}
});
a.open().then(function(){
console.log(1111112);
});
a.close().then(function(){
console.log(1111113);
});;
a.close().then(function(){
console.log(1111114);
},()=>{
console.log(1111222);
});
});
</script>
</body>
</html>