Created
February 4, 2016 16:09
-
-
Save richgcook/1c6112bc048c73c3e91d to your computer and use it in GitHub Desktop.
Cookie with modal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function overlays() { | |
if (!Cookies.get('mailing_list')) { | |
$('.mailing-list-popup').show(); | |
} else { | |
$('.mailing-list-popup').hide(); | |
} | |
$('.mailing-list-popup .close').on('click touchstart', function(e) { | |
Cookies.set('mailing_list', '1', { expires: 7 }); | |
$('.mailing-list-popup').fadeOut(250, function() { | |
$('.mailing-list-popup').removeAttr('style'); | |
}); | |
e.preventDefault(); | |
}); | |
} | |
overlays(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment