HTML
<section class="newsletterfixed" style="display: none;">
<a class="closenewsletter" href="#" onclick="closeNwslt()" >FECHAR</a>
NEWSLETTER AQUI
</section>
Javascript
<script type="text/javascript">
jQuery( document ).ready(function()
{
if (!checkACookieExists())
{
showNwslt();
jQuery( ".closenewsletter" ).click(function(){closeNwslt()});
}
});
function closeNwslt()
{
var now = new Date();
now.setTime(now.getTime() + 1 * 3600 * 1000 * 24);
document.cookie = "newsletter=pocas; expires=" + now.toUTCString() + "; path=/";
jQuery( ".newsletterfixed" ).hide();
}
function showNwslt()
{
jQuery( ".newsletterfixed" ).show();
}
function checkACookieExists()
{
if (document.cookie.split(';').some((item) => item.trim().startsWith('newsletter=')))
{
return true;
}
}
</script>