Streaming live at 10am (PST)

Newsletter Modal cookie inclusion


#1

I have a modal that launches as soon as you visit my clients site. I need it to launch only if you're a first time visitor or if you haven't visited the site within the last 60 days. I'm currently using the below code before the body tag to launch the model. At the moment it launches anytime you go to the homepage. How do I incorporate a cookie function that checks to see if a visitor has been to the site within a set timeframe to control whether the modal launches or not? Thanks in advance!

site: burstgrowth.com

<script type="text/javascript">

$(document).ready(function() {
$('.popup-window-class-here').fadeIn();
$('.close-button-class-here').click(function() {
$('.popup-window-class-here').fadeOut();
});
});

</script>

#2

Hi There,

Not a coder, but I'll probably be attempting to use this info here for a client build with a splash screen. Maybe you'll find it helpful.

If you read down through, they figure it out in a one of those js fiddles. The code looks rather minimal to pull off a "one day" cookie session for showing/hiding a thing. It mentions you'll need to include a cookie library, thankfully - they've also chosen/used one for their demo that is hosted on cdjsn :wink:


#3

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.