Menu icon Foundation
Foundation joyride methods

I was having difficulty getting any of joyrides methods (other than 'start') to work through foundation.

Essentially I was pausing a tour and then wanting it to resume. However:

$(document).foundation('joyride', 'resume');

would result in an error, telling me that this.settings.$li was undefined.

It turns out that calling joyride methods in this way (through foundation) causes the plugin to re-initialize and the settings get overridden by defaults, deleting your current tours settings and meaning $li doesn't exist in that object.

This is the case even though here - http://foundation.zurb.com/docs/javascript.html at the bottom it clearly shows that method of calling internal methods.

A workaround for this is issue is to by-pass the foundation widget and use the global Foundation object. So:

$(document).foundation('joyride', 'resume');

becomes

Foundation.libs.joyride.resume();

This way the method is called and the initialization method is never ran on the plugin, persisting your tours settings.

internal methodsjoyrideFoundation

I was having difficulty getting any of joyrides methods (other than 'start') to work through foundation.

Essentially I was pausing a tour and then wanting it to resume. However:

$(document).foundation('joyride', 'resume');

would result in an error, telling me that this.settings.$li was undefined.

It turns out that calling joyride methods in this way (through foundation) causes the plugin to re-initialize and the settings get overridden by defaults, deleting your current tours settings and meaning $li doesn't exist in that object.

This is the case even though here - http://foundation.zurb.com/docs/javascript.html at the bottom it clearly shows that method of calling internal methods.

A workaround for this is issue is to by-pass the foundation widget and use the global Foundation object. So:

$(document).foundation('joyride', 'resume');

becomes

Foundation.libs.joyride.resume();

This way the method is called and the initialization method is never ran on the plugin, persisting your tours settings.