Search code examples
javascriptimpress.js

Impress.js: How to modify dom using impress.js


I am using impress.js for slides. When I reach the slide number 16, I want impress.js to call a function named myFunction() which modifies the DOM. How can I call myFunction()? p.s When I reach slide no 16 impress.js adds step-16 in url


Solution

  • <script type="text/javascript">
    document.addEventListener("impress:stepenter",function() {
    x = document.activeElement;
    console.log(x);
    if(x.classList[2] == "impress-on-step-16")
          {
             document.getElementById("change").innerHTML = "Graph | Traversals | Breadth First Search"
          }
    }
    

    )