zurb / joyride

jQuery feature tour plugin.
http://www.zurb.com/playground/jquery-joyride-feature-tour-plugin
1.42k stars 238 forks source link

How can i get tour ID in the postRideCallback #161

Open intellisense opened 10 years ago

intellisense commented 10 years ago

For some reasons i needed to get the Tour ID (ol tag id) on which the the joyride was initiated in postRideCallback function. This function only has index and tip as parameter and i have no idea how to get the ID there, i have studied the library and nothing works.

intellisense commented 10 years ago

Declare global variable:

var joyride_parent_id;

Set joyride_parent_id in tip_template:

joyride_parent_id = $(opts.li).parent().attr('id');

Send the parent id in postRideCallback:

settings.postRideCallback(settings.$li.index(), settings.$current_tip, joyride_parent_id);