-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpop.js
More file actions
23 lines (21 loc) · 684 Bytes
/
pop.js
File metadata and controls
23 lines (21 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var parent = document.querySelector(".modal-parent"),
btn = document.querySelector("button"),
X = document.querySelector(".X"),
section = document.querySelector("section");
btn.addEventListener("click", appear);
function appear() {
parent.style.display = "block";
section.style.filter = "blur(10px)"
}
X.addEventListener("click", disappearX);
function disappearX() {
parent.style.display = "none";
section.style.filter = "blur(0px)"
}
parent.addEventListener("click", disappearParent)
function disappearParent(e) {
if (e.target.className == "modal-parent") {
parent.style.display = "none";
section.style.filter = "blur(0px)"
}
}