I have some age-restricted content needed to confirm 18 years old stuff. so I made a cookie check if he clicked “yes I am older 18” button. I simple set cookie and next time he visit check the cookie.
so simply I try to part one is “yes button div” other check function and screen block div..
nothing happens 18block div(screen blocker) always shows.
looking for your help fellas 🙂
thanks
<script type="text/javascript">
$(function () {
if ($.cookie('18ekran') != null) {
$.cookie('18ekran', '18ekran', { expires: 7, path: '/' });
$("#18ekran").attr('style', 'display:none;');
}
});
$("#evet").click(function () {
$("#18ekran").attr('style', 'display:none;');
$.cookie("asucan18", "asucan18", { expires: 7, path: '/' });
});
</script>
It was silly problem just changed the order of jquery script and cookie script. 🙁