【发布时间】:2015-07-29 16:38:25
【问题描述】:
我想知道如何实现一个简单的 LinkedIn HopScotch。
我尝试实施,但未能成功。
以下是我尝试的实现;
<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: "right"
},
]
};
$("#myBtn").click(function() {
hopscotch.startTour(tour);
});
</script>
我应该根据游览对象添加一个 ID 为 hello-hopscotch 的 <div> 吗?
http://cdnjs.com/libraries/hopscotch 是我的库的来源;我已经实现了hopscotch.min.css 和hopscotch.min.js。
我做错了什么,我该如何解决?
【问题讨论】: