Get started with hopscotch CDN

Apache-2.0 licensed

Hopscotch: library, enhances accessibility with keyboard navigation and focus indicators in interactive apps.

Tags:
  • tour
  • linkedin

Stable version

Copied!

How to start using hopscotch CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with hopscotch CDN - cdnhub.io</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hopscotch/dist/hopscotch.css">
  <script src="https://cdn.cdnhub.io/hopscotch/0.3.1/js/hopscotch.min.js"></script>
  <style>
    #tutorial-container {
      position: absolute;
      top: 50px;
      left: 50px;
      width: 300px;
      height: 300px;
      border: 1px solid black;
      padding: 10px;
      background-color: #f9f9f9;
      z-index: 999;
    }
  </style>
</head>
<body>
  <button id="start-tutorial">Start Tutorial</button>
  <div id="tutorial-container">
    <p id="step-1">Click the button to start the tutorial.</p>
    <button id="next-step">Next Step</button>
  </div>
  <script>
    const tutorial = Hopscotch.create({
      target: '#tutorial-container',
      hotkeys: false,
      arrows: false,
      nextText: 'Next Step',
      prevText: false,
      doneText: 'Finish'
    });

    document.getElementById('start-tutorial').addEventListener('click', () => {
      tutorial.show('step-1');
    });

    document.getElementById('next-step').addEventListener('click', () => {
      tutorial.next();
    });
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions