I have a basic form asking to join an email list that I make disappear when someone submits and not reappear by hiding an id in localStorage. I also have a button you can press to make the div disappear should user not want to sign up for email, also done in localStorage. Both of these click events trigger 'hideEmail()'
Is it possible to reverse hiding the id by checking when it was placed in localStorage and if it was over x amount of time change it back?
function hideEmail() {
$('#footer').hide();
localStorage.setItem('hidden', 'true'); //store state in localStorage
}
$(document).ready(function(){
var hidden = localStorage.getItem('hidden');
if(hidden === 'true'){
$('#footer').hide();
}
});