首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >自助旅游不起作用

自助旅游不起作用
EN

Stack Overflow用户
提问于 2016-11-14 07:34:10
回答 2查看 3.1K关注 0票数 0

我正在测试一个非常简单的测试页面,我已经设置了启动带巡回赛。内容显示,但由于某种原因,旅游功能不起作用。有人能告诉我我可能做错了什么吗?

谢谢:)

请在下面找到我的代码

代码语言:javascript
复制
<html>

<head>
    <meta charset="utf-8">
    <title> This is a testing page for bootstrap tour </title>

    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="../bootstraptour/build/css/bootstrap-tour.min.css" rel="stylesheet">
    <link href="../bootstraptour/build/css/bootstrap-tour-standalone.min.css" rel="stylesheet">

</head>


<!-- Bootstrap core JavaScript
  ================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../bootstrap/js/jquery.min.js"></script>
<script src="../bootstrap/js/bootstrap.min.js"></script>
<script src="../bootstraptour/build/js/bootstrap-tour.min.js"></script>
<script src="../bootstraptour/build/js/bootstrap-tour-standalone.min.js"></script>

<script>
    var tour = new Tour();

    // Add your steps. Not too many, you don't really want to get your users sleepy
    tour.addSteps([{
        element: "#content", // string (jQuery selector) - html element next to which the step popover should be shown
        title: "Title of my step", // string - title of the popover
        content: "Content of my step" // string - content of the popover
    }, {
        element: "#content1",
        title: "Title of my step",
        content: "Content of my step"
    }]);

    // Initialize the tour
    tour.init();

    // Start the tour
    tour.start();
</script>


<body>
    <div id="content">
        Hello, World!
    </div>
    <br>
    <br>
    <br>
    <div id="content1">
        Another Hello, World!
    </div>
</body>

</html>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-11-14 08:02:40

您应该包括 bootstrap-tour.min.css/bootstrap-tour.min.js (当您自己包含bootstrap.min.css/bootstrap.min.js时)或bootstrap-tour-standalone.min.css/bootstrap-tour-standalone.min.js,而不是两者兼而有之。请参阅自助旅游主页上的解释。

下面是一个工作片段:

代码语言:javascript
复制
var tour = new Tour();

// Add your steps. Not too many, you don't really want to get your users sleepy
tour.addSteps([{
  element: "#content", // string (jQuery selector) - html element next to which the step popover should be shown
  title: "Title of my step", // string - title of the popover
  content: "Content of my step" // string - content of the popover
}, {
  element: "#content1",
  title: "Title of my step",
  content: "Content of my step"
}]);

// Initialize the tour
tour.init();

// Start the tour
tour.start();
代码语言:javascript
复制
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.11.0/js/bootstrap-tour-standalone.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.11.0/css/bootstrap-tour-standalone.min.css" rel="stylesheet"/>

<div id="content">
  Hello, World!
</div>
<br>
<br>
<br>
<div id="content1">
  Another Hello, World!
</div>

票数 1
EN

Stack Overflow用户

发布于 2020-02-28 11:53:01

您需要清除本地存储,因为引导旅游使用的是localStorage。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40583862

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档