mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
57 lines
1.3 KiB
TypeScript
57 lines
1.3 KiB
TypeScript
/// <reference path="intro.js.d.ts" />
|
|
|
|
var intro = introJs();
|
|
|
|
intro.setOption('doneLabel', 'Next page');
|
|
intro.setOption('overlayOpacity', 50);
|
|
intro.setOption('showProgress', true);
|
|
intro.setOptions({
|
|
steps: [
|
|
{
|
|
intro: "Hello world!"
|
|
},
|
|
{
|
|
element: document.querySelector('#step1') as HTMLElement,
|
|
intro : "This is a tooltip."
|
|
},
|
|
{
|
|
element : document.querySelectorAll('#step2')[0] as HTMLElement,
|
|
intro : "Ok, wasn't that fun?",
|
|
position: 'right'
|
|
},
|
|
{
|
|
element : '#step3',
|
|
intro : 'More features, more fun.',
|
|
position: 'left'
|
|
},
|
|
{
|
|
element : '#step4',
|
|
intro : "Another step.",
|
|
position: 'bottom'
|
|
},
|
|
{
|
|
element: '#step5',
|
|
intro : 'Get it, use it.'
|
|
}
|
|
]
|
|
});
|
|
|
|
intro.start()
|
|
.nextStep()
|
|
.previousStep()
|
|
.goToStep(2)
|
|
.exit()
|
|
.refresh()
|
|
.onbeforechange(function (element) {
|
|
element.getAttribute('class');
|
|
})
|
|
.onafterchange(function (element) {
|
|
element.getAttribute('class');
|
|
})
|
|
.onchange(function () {
|
|
alert('Changed');
|
|
})
|
|
.oncomplete(function () {
|
|
alert('Done');
|
|
});
|