kamranahmedse / driver.js

A light-weight, no-dependency, vanilla JavaScript engine to drive the user's focus across the page

Home Page:https://driverjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Driver is not a function

saschaende opened this issue · comments

I always get the error "driver is not a function". Even on a clean html page:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<div id="haha">adfgadfgadfg</div>

<script src="https://cdn.jsdelivr.net/npm/driver.js@1.0.1/dist/driver.js.iife.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/driver.js@1.0.1/dist/driver.css"/>

<script>
    const driverObj = driver({
        showProgress: true,
        showButtons: ['next', 'previous'],
        steps: [
            { element: '#haha', popover: { title: 'Animated Tour Example', description: 'Here is the code example showing animated tour. Let\'s walk you through it.', side: "left", align: 'start' }},
        ]
    });

    driverObj.drive();

</script>

</body>
</html>

Error in Console:

Uncaught TypeError: driver is not a function
    at test.php:16:23

Okay, i forgot:
const driver = window.driver.js.driver;