Closed ibc closed 3 years ago
+1
The library seems a little confused when it comes to this, it is setup in a way that allows for multiple instances to exist but cleans up existing elements on instantiation of those instances effectively meaning only one can exist.
The biggest problem on this topic is probably the container selectors. A solution is to save container elements as instance properties:
Instead of just globally selecting 'introjs-tooltipReferenceLayer'
, for example, it should save it to the instance as this.tooltipReferenceLayer
, and then in _exitIntro
it can clean up its own reference layer with this.tooltipReferenceLayer.parentNode.removeChild(this.tooltipReferenceLayer)
(what fun).
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.
Why does the Documentation always refer to
introJs().start()
,introJs().exit()
, etc?Given that
introJs()
is a function that returns aIntroJs
"instance" I assume thatstart
/exit
methods must be called on the specific instance. So If I callintroJs().exit()
that means that I'm creating a new instance and directly callingexit()
on it, isn't it?So, can I have multiple
IntroJs
instances at the same time?:Would that work? or is this library designed to handle a single "instance"? If so, that's particularly bad for SPA (single page applications) in which I may need different "tours" within different app "steps".