Add examples for stepg
Browse files- index.html +23 -19
index.html
CHANGED
|
@@ -204,6 +204,8 @@
|
|
| 204 |
<button id="non-animated-tour">Non-Animated Tour</button>
|
| 205 |
<button id="async-tour">Asynchronous Tour</button>
|
| 206 |
<button id="confirm-exit-tour">Confirm on Exit</button>
|
|
|
|
|
|
|
| 207 |
</div>
|
| 208 |
|
| 209 |
<ul>
|
|
@@ -337,25 +339,6 @@ npm install driver.js</pre
|
|
| 337 |
<script type="module">
|
| 338 |
import { driver } from "./src/driver.ts";
|
| 339 |
|
| 340 |
-
const driverObj = driver({
|
| 341 |
-
animate: false,
|
| 342 |
-
});
|
| 343 |
-
|
| 344 |
-
driverObj.highlight({
|
| 345 |
-
element: "h1",
|
| 346 |
-
popover: {
|
| 347 |
-
title: "A popover",
|
| 348 |
-
side: 'bottom',
|
| 349 |
-
description: "Working on the close functionality right now. Turning it into a small cross button on top right corner.",
|
| 350 |
-
showProgress: true,
|
| 351 |
-
progressText: "Some <strong>HTML</strong>",
|
| 352 |
-
showButtons: ["close", "next", "previous"],
|
| 353 |
-
onCloseClick: () => {
|
| 354 |
-
driverObj.destroy();
|
| 355 |
-
}
|
| 356 |
-
}
|
| 357 |
-
});
|
| 358 |
-
|
| 359 |
const basicTourSteps = [
|
| 360 |
{
|
| 361 |
element: ".page-header",
|
|
@@ -439,6 +422,27 @@ npm install driver.js</pre
|
|
| 439 |
driverObj.drive();
|
| 440 |
});
|
| 441 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 442 |
document.getElementById("async-tour").addEventListener("click", () => {
|
| 443 |
const driverObj = driver({
|
| 444 |
animate: true,
|
|
|
|
| 204 |
<button id="non-animated-tour">Non-Animated Tour</button>
|
| 205 |
<button id="async-tour">Asynchronous Tour</button>
|
| 206 |
<button id="confirm-exit-tour">Confirm on Exit</button>
|
| 207 |
+
<button id="progress-tour">Progress Text</button>
|
| 208 |
+
<button id="progress-tour-template">Progress Text Template</button>
|
| 209 |
</div>
|
| 210 |
|
| 211 |
<ul>
|
|
|
|
| 339 |
<script type="module">
|
| 340 |
import { driver } from "./src/driver.ts";
|
| 341 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
const basicTourSteps = [
|
| 343 |
{
|
| 344 |
element: ".page-header",
|
|
|
|
| 422 |
driverObj.drive();
|
| 423 |
});
|
| 424 |
|
| 425 |
+
document.getElementById("progress-tour").addEventListener("click", () => {
|
| 426 |
+
const driverObj = driver({
|
| 427 |
+
animate: true,
|
| 428 |
+
steps: basicTourSteps,
|
| 429 |
+
showProgress: true,
|
| 430 |
+
});
|
| 431 |
+
|
| 432 |
+
driverObj.drive();
|
| 433 |
+
});
|
| 434 |
+
|
| 435 |
+
document.getElementById("progress-tour-template").addEventListener("click", () => {
|
| 436 |
+
const driverObj = driver({
|
| 437 |
+
animate: true,
|
| 438 |
+
steps: basicTourSteps,
|
| 439 |
+
showProgress: true,
|
| 440 |
+
progressText: "{{current}} of {{total}} done",
|
| 441 |
+
});
|
| 442 |
+
|
| 443 |
+
driverObj.drive();
|
| 444 |
+
});
|
| 445 |
+
|
| 446 |
document.getElementById("async-tour").addEventListener("click", () => {
|
| 447 |
const driverObj = driver({
|
| 448 |
animate: true,
|