我想知道为什么我的 Bootstrap Tour 没有在点击时启动。
请参阅下图以获取参考和代码。请注意,我省略了页面的大部分代码,因为我不想让你不知所措。希望这里有足够的内容让您完成这次旅行。
我做错了什么?
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.11.0/css/bootstrap-tour.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Button for Tour Start -->
<a id="MSL-initialize-tour" class="MSL-tour-button MSL-white-button" href="#">START TOUR</a>
<img id="MSL-tour-welcome" class="MSL-Headine-Desktop" src="https://sephora.csod.com/clientimg/sephora/welcome/1-22-18_Headline_V2.png" />
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.11.0/js/bootstrap-tour.min.js"></script>
<script>
// Instance the tour
var tour = new Tour({
steps: [
{
element: "#MSL-tour-welcome",
placement: "top",
title: "<span class='glyphicon glyphicon-star'></span> Welcome to MSL!",
content: "Press 'next' to see page features"
}
]});
$('#MSL-initialize-tour').click(function(){
tour.init();
tour.start();
});
</script>