i have script in my popup
$(function() {
$('.window_content a.window_close').on('click', function(e) {
e.preventDefault();
$(this).parent().removeClass('opened');
$('#window_overlay').removeClass('opened');
});
$('.window_content').addClass('opened');
$('#window_overlay').addClass('opened');
I need to add a cookie support so that this popup is displayed at the specified time and it was not displayed every time the page was refreshed
Any help really appreciated, thank you!
Now i Try Use LocalStorage but popup does not disappear from the page when i refresh ;/
<script>
$(function() {
$('.window_content a.window_close').on('click', function(e) {
e.preventDefault();
$(this).parent().removeClass('opened');
$('#window_overlay').removeClass('opened');
});
if(localStorage.getItem('window_overlay') != 'shown') {
$(this).delay(2000).fadeIn();
localStorage.setItem('window_overlay','shown')
}
$('.window_content').addClass('opened');
$('#window_overlay').addClass('opened');
});
</script>