Reputation: 11
if (!sessionStorage.getItem('introSkipped')) {
introJs()
.setOptions({
steps: [
{
element: document.querySelector('#test'),
intro: "lorem ipsum."
},
],
showStepNumbers: true,
exitOnOverlayClick: false,
hidePrev: true,
})
.onexit(function() {
sessionStorage.setItem('introSkipped', 'true');
})
.start();
}
The intro.js element can use an ID or class to call the intro.js. So, if I want to use intro JS, that means I have to put that code on every page I want to provide intro JS
I have 2 questions
So what if I want intro.js to be global, what this means is that I don't need to put that code on every page I want to implement intro.js on. I want to create a page to add or edit intro.js and later the edited page will change to intro.js?
and I don't want to use the ID or class element to call intro.js, because my output here is that not only the developer team can add or edit intro js, but teams other than developers can also add or edit it without knowing the ID, so is there a way besides using element id or class to call intro.js?
i use codeigniter
Upvotes: 1
Views: 32