跳房子按钮单击不工作

时间:2016-07-02 07:50:58

标签: javascript jquery html css

关于以下跳房子为什么不进行以下工作的任何想法?我们希望用户能够点击按钮开始游览。 非常感谢!

<html>
  <head>
    <title>My First Hopscotch Tour</title>
    <link rel="stylesheet" href="css/hopscotch.css">
  </head>
  <body>

    <h1 id="header">My First Hopscotch Tour</h1>
    <div id="content">
      <p>Content goes here...</p>
    </div>
    <button id="myBtn">Click Me</button>

    <script>
      var tour = {
        id: "hello-hopscotch",
        steps: [
          {
            title: "My Header",
            content: "This is the header of my page.",
            target: "header",
            placement: "bottom"
          },
        ]
      };
      $("#myBtn").click(function(){
        hopscotch.startTour(tour);
      });
    </script>

    <script src="js/hopscotch.js"></script>

  </body>
</html>

2 个答案:

答案 0 :(得分:0)

您应该在文件的head部分包含jquery库。

即:

<script src="https://code.jquery.com/jquery-3.0.0.min.js" integrity="sha256-JmvOoLtYsmqlsWxa7mDSLMwa6dZ9rrIdtrrVYRnDRH0=" crossorigin="anonymous"></script>

答案 1 :(得分:0)

添加Jquery脚本:

can not resolve symbol beginTransaction

请参阅演示: http://codepen.io/ihemant360/pen/OXmqXR