I want to have two separate tours in a single webpage using introJs. But while doing this, data-steps of one tour is coinciding with the other tour.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
I had similar situation, where I had two panels in the page. Each panel has its help section. However for when I was clicking on one help section, intro js was getting activated in the other too. I removed all the intro js attributes every time I start help, so that one help section won't be able to activate the other.
$('[data-intro]').removeAttr('data-intro data-position data-step');
Simply it's impossible.
You can't have two tours for the whole page (
document.body
) at once, instead of this you can create two separate tours for separate elements on the DOM.Like @brianlmerritt, I made two programmatic intro.js and launch it with different buttons.
Set up different instances and steps and call them intro1 and intro2 (or whatever else you want).
You can then trigger them independently as intro1.start() and intro2.start()
See the code to set up the steps below:
The beauty is you don't need as much meta information embedded in the html, just