ufaclub,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
(function(num, key, fn, duration) {
var ar = JSON.parse(localStorage.getItem(key) || "[]");
var date = new Date;
ar = ar.filter(function(time) {
return time > date.getTime()
});
if(ar.length < num) {
ar.push(date.getTime() + duration);
localStorage.setItem(key, JSON.stringify(ar));
fn(ar.length)
}
})(3, 'depository', function(length) {
alert(length); // $('a.open').trigger('click');
}, 24 * 60 * 60 * 1000)
});
</script>
</head>
<body>
</body>
</html>