CORONER,
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<style>
.window_show {
display: none;
z-index: 1000;
position: fixed;
width: 200px; height: auto;
right: 20px;
bottom: 20px;
padding: 15px;
text-align: center;
border-radius: 10px;
}
.green {
color: #fff;
background: #36549a;
border: 3px solid #7f98c0;
}
.green a {
color: #fff;
}
.window_show.act{
display: block;
}
</style>
</head>
<body>
<div class='window_show green'>Заказ удален<button id="off">Отключить уведомление</button></div>
<script>
window.addEventListener("DOMContentLoaded", function() {
var div = document.querySelector(".window_show"), hide = "abcd", i = 0, s = ["block", "none"], t;
function rnd() {
return 1000 + (Math.random() * 15000 | 0);
}
function clear() {
window.clearTimeout(t);
}
function getItem() {
return localStorage.getItem(hide);
}
function show() {
clear();
i ^= 1;
div.style.display = s[i];
!getItem() && (t = window.setTimeout(show, i ? rnd() : 5000));
}
!getItem() && show();
div.addEventListener("click", function() {
localStorage.setItem(hide, "hide");
show();
});
div.addEventListener("mouseenter", clear);
div.addEventListener("mouseleave", show);
});
</script>
</body>
</html>