#Polymer Walk Tour Element.
DEMO - https://aruntk.github.io/walk-tour/
Presents a web application by showing contextual dialogs and highlighting elements on the page.
This element shows a guided tour through a web application. The different steps of the tour can be easily configured.
Tour can be controlled using keyboard events as well mouse click events
Right key for Next Left key for Previous Esc key for Skip
- Import walk-tour.html.
- Include
<walk-tour></walk-tour>
tag in project - Use MyMixins.WalkTourMixin in your web component.
- Call
_showhelp
Function from web component whose help is to be shown
this._showHelp( element , Message Title, Message Body, Version Number);
For Eg
this._showHelp( this.$.searchboxx , "Search Box" ," I am search box",1, 'optional_unique_id');
Note that id is used as a key to save cookies. So remember to set an id to the element.
this._showHelp( this.$.searchboxx , "Search Box" ," I am search box with changed message",2, 'optional_unique_id');
If you have more than one elements with same id (possibly inside two different custom elements) or and element with no id you'll have to pass a unique id to show separate tours for the elements.
this._showHelp( this.querySelector('search-box-1') , "Search Box 1" ," I am search box 1", 1, 'sb1');
this._showHelp( this.querySelector('search-box-2') , "Search Box 2" ," I am search box 2", 1, 'sb2');
this._showHelp( elementA.$.searchboxx , "Search Box inside element A" ," I am search box", 1, 'sba');
this._showHelp( elementB.$.searchboxx , "Search Box inside element B" ," I am the other search box", 1, 'sbb');
For Eg
this._showHelp(this.$.searchboxx ,"Search Box", ["Search Your Queries Here Powered By Google!",
"Bullets can be used as well",
"Bullet 2","Bullet 3"],
1);
For Eg to show help after 15 sec
setTimeout(() => {
this._showHelp(this.$.searchbox ,"Search Box", ["Search Your Queries Here Powered By Google!","Bullets can be used as well","Bullet 2","Bullet 3"],1);
}
,15000);
<walk-tour welcome-Show="false" welcome-title="Welcome Title to be shown" welcome-msg=="Welcome Message to be shown" ></walk-tour>
Default Values are:
welcomeShow:true,
welcomeTitle:"Welcome",
welcomeMsg:"You can go to and fro between elements using mouse as well as keyboard (left, right keys and esc key to exit). Click on screen to move to next"
Clear the walk-tour-viewed key value pair from localstorage.
document.querySelector("walk-tour").reset();
Now run this._showHelp
.