Quick walk through IntorJs
Posted By : Saloni Arora | 31-May-2019
Here is the following steps to implement :-
npm install intro.js --save
targetElem:- It creates an IntroJs object. String should be explained to start the introduction for specific element. For example #intro-farm
introJs():- without selector, it starts introduction for whole page.
introJs(“intro-farm”):- It starts introduction for the element id=’intro-farm’.
It starts the introduction for defined elements
It goes to the specific set of introduction
introJs().goToStep(2).start(); // It starts the introduction from step2
This is different from the previous name because the data-step does not need to be continuous. It runs in a random number.
<div id=”first” data-step=”2”></div>
<div id=”second” data-step=”5”></div>
It is used to add new step to the introJs
intro:”How are you”,
It goes to the next step of introduction
So these are the methods which are used in introJs and many more methods are also there in introJs. We can also use JSON to setup introJs because it not convenient to manually add the introjs attributes for the specific element we can also make the array for the specific elments.
intro:”This is the title of the web page’,
intro:’This is the description of the web’,
We create the instance of the introJS and load the data using the setOptions and we frequently start the tour.
// Initialize the introJs instance
Pass in the steps array which is created earlier
Here the introJs starts