问题描述
所以我在我的应用程序中添加了引导浏览功能,但是我无法弄清一件事。 当我重定向到另一个页面时,如何继续显示游览。它仅对第一个主页有效。在第一个重定向中,我在本地存储中设置了值,所以我在其他控制器中获取了它,如果存在,它将触发在该页面上显示游览。提前致谢。如果您需要更多代码,我可以提供。 这是我的代码:
var tour = new Tour({
steps: [
{
element: "#panel1",title: "Welcome to MmmooOgle Ration",content: '<div class="embed-responsive embed-responsive-16by9" style="width:250px; height:260px;"><iframe width="1280" height="720" src="https://www.youtube.com" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>',placement: "bottom",onNext: function(){
localStorage.setItem('fromDashboard',true);
},},{
path: function redirect(state) {
$state.go('teams.myTeams');
},}
],backdrop: true,storage: false
});
// tour.init();
// tour.start();
tour.init();
// tour.start();
$("#startTourBtn").click(function() {
tour.restart();
});
在我重定向的其他控制器中:
var tour = new Tour({
steps: [
{
element: "#panel2",title: "2nd guide",content: "This is active herd",{
element: "#panel3",title: "3rd guide",content: "This is active group",placement: "bottom"
},{
element: "#panel4",title: "4th guide",content: "This is list of Feeds",{
element: "#panel5",title: "5th guide",content: "This is list of rations",placement: "bottom"
}
],storage: false
})
tour.init();
if(vm.fromDashboard){
tour.restart();
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)