-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (19 loc) · 773 Bytes
/
script.js
File metadata and controls
24 lines (19 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function desvia() {
var btn = document.getElementById("nao");
btn.style.position = 'absolute';
btn.style.bottom = numeroAleatorio(10, 90);
btn.style.left = numeroAleatorio(10, 90);
}
function numeroAleatorio(min, max) {
return (Math.random() * (max - min) + min) + '%'
}
function showPopup() {
document.getElementById("popup").style.display = "block";
document.body.style.overflow = "hidden"; // Prevent scrolling when the popup is open
document.getElementById("overlay").style.display = "block";
}
function hidePopup() {
document.getElementById("popup").style.display = "none";
document.body.style.overflow = "auto"; // Enable scrolling when the popup is closed
document.getElementById("overlay").style.display = "none";
}