I'm using Foundation Joyride and every time I load the webpage the tour starts, but how do I only start the tour for the first time the webpage is loaded?
My settings are ...
$(window).load(function() {
//Foundation Joyride (Tour)
$("#tour").joyride({
'cookieMonster': true,
'cookieName': 'JoyRide',
'cookieDomain': 'mydomain.co.uk/',
'postRideCallback' : function () {
$(this).joyride('destroy');
},
cookieMonster: false
});
});
Got it working at last and it turned out to be the order in which the header files were declared.
You have to use the
cookieMonster
option se to true, with your domain or false incookieDomain
.Also remove the
cookieMonster: false
outside of the parenthesis.To let joyride use cookies you must include the
jQuery.cookie
library in your page (https://github.com/carhartl/jquery-cookie)Here is a sample:
In this way you'll see the tour only the first time you visit the page (or when you clear the cookies).