我有以下非常简单的演示设置在我的网站和这把小提琴。它实际上与官方演示完全相同。在这两种情况下我都不去旅游。我遗漏了什么?
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.8.1/css/bootstrap-tour.min.css">
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script type='text/javascript' src='http://code.jquery.com/jquery-git.js'></script>
<script type='text/javascript' src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script type='text/javascript' src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.8.1/js/bootstrap-tour.min.js"></script>
<button class="btn" id="tour-go">Start the tour!</button>
<form>
<input id="one" value="one" />
<input id="two" value="two" />
<input id="three" value="three" />
</form>
$(function () {
var tour = new Tour({
steps: [{
element: "#one",
title: "Title of my step",
content: "Content of my step"
}, {
element: "#two",
title: "Title of my step",
content: "Content of my step"
}, {
element: "#three",
title: "Title of my step",
content: "Content of my step"
}]
});
// Initialize the tour
tour.init();
$('#tour-go').click(function () {
// Start the tour
tour.start();
});
});发布于 2014-05-12 20:38:37
您使用的是引导浏览v0.8.1,所以您的代码不正确,正确的代码应该是:
var tour = new Tour() ;
tour.addSteps([{
element: "#one",
title: "Title of my step",
content: "Content of my step"
}, {
element: "#two",
title: "Title of my step",
content: "Content of my step"
}, {
element: "#three",
title: "Title of my step",
content: "Content of my step"
}]) ;这把小提琴起作用了:http://jsfiddle.net/9LcQx/
发布于 2014-05-12 20:34:56
用你的小提琴中的这个替换js
$(function () {
var tour = new Tour();
tour.addStep({
element: "#one",
title: "Step 1",
content: "Content for step 1"
});
tour.addStep({
element: "#one",
title: "Step 2",
content: "Content for step 2"
});
tour.addStep({
element: "#three",
title: "Step 3",
content: "Content for step 3"
});
// Initialize the tour
tour.init();
$('#tour-go').click(function () {
// Start the tour
tour.start();
});
});发布于 2015-10-27 11:13:28
我尝试了所有以上提出的解决方案,但仍然无法使它工作,所以我在网上找到了一篇文章,其中指出,现有的引导用户是而不是,应该使用bootstrap-tour-standalone.min.js。相反,他们应该使用boostrap-tour-min.js。
另外,请验证您正在使用适当版本的引导程序。“波波斯”在我的案例中没有出现
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>https://stackoverflow.com/questions/23569338
复制相似问题