Quark_,
для примера 5 сек, успейте перезагрузить после клика.
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
#ppp {
display: none;
}
#ppp.open {
display: block;
}
</style>
</head>
<body>
<div id="ppp">
ppp
<button type="button" id="ppp_close">ppp_close</button>
</div>
<script>
document.addEventListener("DOMContentLoaded", function() {
var limit = 5000; //24 * 3600 * 1000; // 24 часа
var localStorageInitTime = localStorage.getItem('localStorageInitTime') || new Date() - limit;
var delta = new Date() - localStorageInitTime;
console.log(delta >= limit)//true - время вышло
var idPC = document.getElementById('ppp_close');
var idPB = document.getElementById('ppp');
if (delta >= limit) {
idPB.classList.add('open');
}
function onclickPC() {
idPB.classList.remove('open');
localStorage.setItem('localStorageInitTime', +new Date());
}
idPC.addEventListener('click', onclickPC)
});
</script>
</body>
</html>