1
I have a modal that when the mouse cursor leaves the page it appears a modal, but every time it leaves the page it keeps appearing, I wonder if there is how to verify that from the moment it appeared once it does not appear more until a refresh on the page? Only using HTML and JS
<!DOCTYPE html>
<html lang="en" onmouseleave="abreModal()">
<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">
<link rel="stylesheet" href="style.css">
<title>Document</title>
<script type="text/javascript">
function abreModal() {
opsc = document.getElementById("openModal").style.opacity = "1";
disp = document.getElementById("openModal").style.display =
"block";
}
function fechaModal(){
opsc = document.getElementById("openModal").style.opacity = "0";
disp = document.getElementById("openModal").style.display =
"none";
}
</script>
</head>
<body>
<div id="openModal" class="modalDialog">
<div>
<a href="#close" title="Close" onclick="fechaModal();"
class="close">X</a>
<h2>Modal Box</h2>
<p>1 paragrafo.</p>
<p>teste teste teste teste teste teste v</p>
</div>
</div>
</body>
</html>