I have a pop-over modal that I upload to my page when it loads, I would like to do this as soon as it is closed so as not to be displayed again for this user. I did similar things with localStorage(); but for some reason I canβt understand the syntax to make this work.
I tried the solution in which it sets the class, but when updating it will reload the original item, so now I try this idea when I change the modality state to βvisitedβ. Any ideas what I could lose to get this to work the way I hope?
localStorage function:
$(function() { if (localStorage) { if (!localStorage.getItem('visited')) { $('.projects-takeover').show(); } } else { $('.projects-takeover').show(); } $('.projects-close').click(function() { $('.projects-takeover').fadeOut(); }); localStorage.setItem('visited', true); return false; });
Below is jsfiddle using code, thanks for help!
source share