I’m using the following code to display two div containers after 3 minutes:
/* Display After 3 Minutes (180000) */
setTimeout("jQuery('#contact-overlay, #contact-window').show();", 180000);
I only want these div containers to open after 3 minutes on the first 4 visits to the website, after this the div containers should not open for that user again. I assume this could be tracked using the jquery cookies script, but I’m not quite sure how I would get this working.
Get the cookie plugin from the link here:
http://www.electrictoolbox.com/jquery-cookies/
Open only on the first 4 visits to the site:
Or to open only on the first 4 times the user actually sees the box, move the cookie incrementing line into the body of the overlayContact function, before the if.