我目前正在处理一个项目,需要在页面上展示一个导览。
我看了一下Bootstrap-Tour,感觉还不错。我正在使用angularJS控制器进行开发。所以我创建了一个Tour,添加了一些步骤,并创建了一个按钮,该按钮会触发AngularJS控制器中的StartTour()函数:
var t = new Tour({container: "#main",
backdrop: false,
debug:true,
orphan: true
});
t.addStep({
element: "#content123",
title: "Title123",
content: "Content123"
});
t.addSteps(
[
{
element: ".message.message-1", // element selector to show the popover next to;
title: "Welcome to my tour!",
content: "We're going to make this quick and useful."
},
{
element: ".message.message-2",
title: "Let's finish this thing off with a bang.",
content: "Boom, bang, bam!"
}
]);
// Initialize method on the Tour class. Get's everything loaded up and ready to go.
$scope.StartTour = function(){
// t.init();
t.start(true);
console.log(t);
console.log("start!!");
}
我现在面对的问题是,如果我在创建新的旅游时不调用orphan:true,当我点击按钮时什么都不会发生。我该如何解决这个问题?也许一些Angular的人已经使用过这个工具了?以后,我想将其打包到指令中。