1.0.41 • Published 4 years ago

yatra-tour-js v1.0.41

Weekly downloads
20
License
MIT
Repository
github
Last release
4 years ago

A simple light weight and easy to use website tour library.

installation

Add CDN for default tour modal (https://npmcdn.com/yatra-tour-js@latest/yatra.css) required

install package

npm i yatra-tour-js

or using script

<script src="https://npmcdn.com/yatra-tour-js@latest/index.js" type="text/javascript"></script>

usage

const elements = [
    {
        selector : 'someclass',
        message : 'Hi there'
    }, {
        selector : 'someclass1 someclass2',
        message : 'Same message for different classes'
    }
];
const config = {padding : 10, allowSkip : false, overlayOpacity : .3};
const yatra = new YatraIntro(elements, config);
yatra.start()

Optional configs

ConfigDefinitionType
paddingPadding between actual tour modal and active elementNumber
allowSkipSkip ongoing tour in between (true by default)Boolean
customModalcustom tour modal having %content%, %next_button% & %back_button% as HTML stringString
overlayOpacityadjust opacity of overlay divnumber

Optional callback

new YatraIntro(elements, null, onUserAction.bind(this)).start()
function onUserAction(action){
    //action = next | previous | skipped | completed
}

Custom tour modal template

    <div id="yatra-data-control" class="my-own-class">
        <div id="yatra-data-content" class="my-own-message-div-class"></div>
        <div class="my-own-modal-control-class">
            <div id="yatra-data__next">Next</div>
            <div id="yatra-data__back">Back</div>
        </div>
    </div>

Demo

1.0.41

4 years ago

1.0.4

4 years ago

1.0.302

4 years ago

1.0.301

4 years ago

1.0.3

4 years ago

1.0.21

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago