Closed iq-dot closed 4 years ago
One of the ways is to define different tours for different sections.
Eg.
var feature1 = introJs();
var feature2 = introJs();
feature1.setOptions({
steps:[
{
...
},
{
...
},
]
})
.oncomplete(function(){
setTimeout(function(){ feature2.start(); },500)
})
feature1.setOptions({
steps:[
{
...
},
{
...
},
]
});
I took a slightly different approach by using a custom data-attribute, then match that 'token' against my JSON array:
{
"token": "global_pages",
"steps": [
{
"intro": "asdf."
},
<button class="button js-start-tour" data-token="global-pages>Click Me!</button>
then
(see underscore docs, btu you can do this natively as well...)
$('.js-start-tour).on('click', function() {
var tour = _.findWhere(parsedJson, {token: token});
pageTour = introJs();
//you can jam in some other options into that tour variable.
pageTour.setOptions({steps: tour.steps})
pageTour().start()
});
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is there a way to define the step number in the JSON object? e.g.:
?
I am basically trying to create a multi-section intro, which due to the tech stack (AngularJS) and single page nature, I need to rely on step numbers to specifically sub-divide parts of my IntroJS object using steps.
Ideally it would be great if I could sub-divide using labels instead:
Now I don't think something like that exist but the step numbers exist in the 'data-step' attributes so is there an equivalent in the programmatic way?
Thanks