Hey
I have a popup that activates when your cursor is off the canvas (exit popup).
Here’s the link
The problem is that the javascript code suppose to save the cookies so it won’t show up again, but it doesn’t work until you actually refresh the page.
How to make it pop up just once and then don’t bother again?
Here’s the javascript of the popup
<!-- this is cookie for the exit popup -->
<script>
var Webflow = Webflow || [];
Webflow.push(function() {
// Load cookie library
$.getScript('https://cdn.rawgit.com/js-cookie/js-cookie/v2.1.2/src/js.cookie.js', function() {
// If cookie found (already shown)
if(Cookies.get('notice3') !== undefined) {
// Hide cookie notice (change jQuery selector to match your own)
$('.popup').remove();
}
// On button click
$('.popup').click(function() {
// Calculate when you want to display the notice again (change 15 to number of minutes you want)
var expireTime = new Date(new Date().getTime() + 60000 * 60 * 24 * 365);
// Set this cookie
Cookies.set('notice3', 'shown', { expires: expireTime });
});
});
});
</script>
<!-- end exit popup cookie -->
Here is my public share link: LINK
(how to access public share link)