Question

I tried to start with impress.js to create some HTML/CSS3 presentations.
Unfortunately I cannot get even the simplest example working.

<html lang="en">
<head>
    <title>Impress Demo</title>
</head>
<body>
    <div id="impress">
        <div id="start">
            <p style='width:1000px;font-size:80px;text-align:center'>Creating Stunning Visualizations</p>
            <p>Impress.js</p>
        </div>

        <div id="slide2" data-x="-1200" data-y="0">
            <p style='width:1000px;font-size:80px;'>First Slide Moves From Left To Right</p>
            <p>Impress.js</p>
        </div>
    </div>

    <script type="text/javascript" src="../js/impress.js"></script>
    <script type="text/javascript">impress().init();</script>
</body>

Howver, in Firefox (tested also in Chrome) I get the following error in dev console:

Empty string passed to getElementById() @ impress.js:90

Any ideas?

Was it helpful?

Solution

Every div that you want to be a step in div#impress should have a class="step" added to it.

This code should work

<div id="impress">
    <div class="step" id="start">
        <p style='width:1000px;font-size:80px;text-align:center'>Creating Stunning Visualizations</p>
        <p>Impress.js</p>
    </div>

    <div class="step" id="slide2" data-x="-1200" data-y="0">
        <p style='width:1000px;font-size:80px;'>First Slide Moves From Left To Right</p>
        <p>Impress.js</p>
    </div>
</div>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top