更改路径后,Bootstrap巡视停止工作

时间:2014-10-08 08:37:54

标签: twitter-bootstrap path bootstrap-tour

请在更改页面后帮我继续引导游览。这是我的page1.html代码

<body>
<div>
Page 1
   <a class="btn btn-default"> Start the Tour </a>

                <br/>

        <span id="element1">First Element </span>


        <br/><br/><br/><br/><br/><br/><br/><br/><br/>

        <span id="element2">Second Element</span>

        <br/><br/><br/><br/><br/><br/><br/><br/><br/>

        <span id="element3">Third Element</span>

<br/><br/><br/>
</div>
        <a href="https://google.com"> Google.com </a>

</body>


<script type="text/javascript">
var tour1 = new Tour({
    orphan:false,
    debug:true,
    backdrop:true,
    orphan:true,
    keyboard:true,
    name:'tour1',
  steps: [
        {
            path:"",
            element: "#element1",
            title: "Title of my step 1",
            content: "Content of 1"
        },
        {
            path:"",
            element: "#element2",
            title: "Title of my step 2",
            content: "Content of 2"
        },
        {
            path:"",
            element: "#element3",
            title: "Title of my step 3",
            content: "Content of 3"
        },
        {
            path:"page2.html",
            element: "#element4",
            title: "Manage People",
            content: "This is the Manage People title page"
        }
]});

// Initialize the tour
tour1.init();

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

这是page2.html

<body>
Page 2

                <br/>

        <span id="element4">Fourth Element </span>


        <br/><br/><br/><br/><br/><br/><br/><br/><br/>

        <span id="element5">Fifth Element</span>

        <br/><br/><br/><br/><br/><br/><br/><br/><br/>

        <span id="element6">Sixth Element</span>


</body>
<script type="text/javascript">
var tour1 = new Tour({
    orphan:false,
    debug:true,
    backdrop:true,
    orphan:true,
    keyboard:true,
    name:'tour1',
  steps: [
        {
            path:"",
            element: "#element1",
            title: "Title of my step 1",
            content: "Content of 1"
        },
        {
            path:"",
            element: "#element2",
            title: "Title of my step 2",
            content: "Content of 2"
        },
        {
            path:"",
            element: "#element3",
            title: "Title of my step 3",
            content: "Content of 3"
        },
        {
            path:"page2.html",
            element: "#element4",
            title: "Manage People",
            content: "This is the Manage People title page"
        }
]});

// Initialize the tour
tour1.init();

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

在第4步之后,bootstrap tour重定向到第2页,但是popover消失了,巡回赛停止了。我试图改变路径,但无法解决任何问题。任何有自助游的人都请帮帮忙,谢谢

1 个答案:

答案 0 :(得分:0)

您最后一步有2条路径:

{ 
        path:"page2.html",
        element: "#element4",
        path:"page2.html",  
        title: "Manage People",
        content: "This is the Manage People title page"
    }

应该是这样的:

{
        path:"page2.html",
        element: "#element4",
        title: "Manage People",
        content: "This is the Manage People title page"
    }