How to Webflow: Adding cookies to custom modals

Oct 22, 2019

<script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js"></script>

<script>
var cookieName = 'modalClosed';

if(typeof Cookies.get(cookieName) !== 'undefined') {
$('.modal').remove();
}

$('.close-modal-bg, .close-modal').on('click', function(){
Cookies.set(cookieName, 'ok', { expires: 7 });
})
</script>

More videos