2014-12-22 31 views

回答

1

'storage'需要'window.localStorage'。这个值是默认的,所以你不需要添加任何选项。

// Instance the tour 
 
var tour = new Tour(); 
 

 
tour.addSteps([ 
 
    { 
 
     element: "#one", 
 
     title: "First", 
 
     content: "First Content", 
 
     placement: "right" 
 
    }, { 
 
     element: "#two", 
 
     title: "Second", 
 
     content: "Second content", 
 
     placement: "right" 
 
    } 
 
]); 
 

 
tour.init(); 
 
tour.start(); 
 

 
$("#startTour").click(function() { 
 
    tour.restart(); 
 
})
div#one { 
 
    padding:20px; 
 
    margin:50px; 
 
    width:100px; 
 
    height:100px; 
 
    background-color:gray; 
 
} 
 
div#two { 
 
    padding:20px; 
 
    margin:50px; 
 
    width:100px; 
 
    height:100px; 
 
    background-color:aqua; 
 
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.css" rel="stylesheet"/> 
 
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.10.1/css/bootstrap-tour.css" rel="stylesheet"/> 
 

 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.js"></script> 
 
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.js"></script> 
 
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.10.1/js/bootstrap-tour.js"></script> 
 

 
<div id="one">First step</div> 
 
<br> 
 
<div id="two">Second step</div> 
 
    
 
    <div> 
 
     <button id="startTour" class="btn btn-success">Start</button> 
 
    </div>

相关问题