首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不同页面间的BootstrapTour导航问题

不同页面间的BootstrapTour导航问题
EN

Stack Overflow用户
提问于 2014-04-09 06:49:41
回答 1查看 790关注 0票数 1

我用的是自助旅游。它很好地工作在单页,并有效地从一个页面(first.html)到另一个(second.html)的帮助下,“下一步”按钮.问题是,当我按下前一个按钮(在second.html)页面时,它永远不会转到first.html页面。对解决这个问题的任何帮助

我的密码在下面

newly.html(FirstPage)

代码语言:javascript
复制
<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
    <script src="//code.jquery.com/jquery-1.10.1.min.js"></script>
    <link href="build/css/bootstrap-tour-standalone.min.css" rel="stylesheet" />
    <script src="build/js/bootstrap-tour-standalone.min.js"></script>
    <script src="build/js/Script.js"></script>


    <style>
        .new {
            margin: 20px auto;
            width: 500px;
            padding: 50px;
            background: #EBEBEB;
        }


    </style>
</head>
<body>
    <div id="test" class="new">
        <h1>Header Part</h1>
    </div>

    <div id="test1" class="new">
        <h1>Footer Part</h1>
    </div>


</body>
</html>

mine.html(SecondPage)

代码语言:javascript
复制
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <script src="//code.jquery.com/jquery-1.10.1.min.js"></script>
    <link href="build/css/bootstrap-tour-standalone.min.css" rel="stylesheet" />
    <script src="build/js/bootstrap-tour-standalone.min.js"></script>
    <script src="build/js/Script.js"></script>
    <title>mine</title>
</head>
<body>

    <style>
        .man {
            float: left;
            background: red;
            width: 400px;
        }
    </style>
    <div id="dumy" class="man">
        <h1>This is My Self Made Div</h1>
    </div>
</body>
</html>

script.js

代码语言:javascript
复制
$(function () {
    var tour = new Tour({
        steps: [
        {
            element: "#test",
            title: "Title of my step",
            content: "This is Header"
        },
        {

            element: "#test1",
            title: "Title of my step",
            content: "This is footer"
        },
        {
            path: "/mine.html",
            element: "#dumy",
            title: "Title of my step",
            content: "I made this step own",
           // backdrop: true

        }
        ]
    });
    // Initialize the tour
    tour.init();

    // Start the tour
    tour.start();
});
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-04-10 06:37:32

经过一段时间的思考,花了一天时间,终于找到了答案.只有一句话让我坚持了一整天:\

编辑第二步或向第二步添加路径

更新的Script.js

代码语言:javascript
复制
$(function () {
    var tour = new Tour({
        steps: [
        {
            element: "#test",
            title: "Title of my step",
            content: "This is Header"
        },
        {   
            //add path to the second step
            path: "/newly.html",
            element: "#test1",
            title: "Title of my step",
            content: "This is footer"
        },
        {
            path: "/mine.html",
            element: "#dumy",
            title: "Title of my step",
            content: "I made this step own",
           // backdrop: true

        }
        ]
    });
    // Initialize the tour
    tour.init();

    // Start the tour
    tour.start();
});
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22954880

复制
相关文章

相似问题

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