我使用 yii2 作为后端框架,我想为我的应用程序制作游览,但是第二页上没有显示引导游览弹出框,我为引导游览创建了一个资产包并将其注册到布局中,引导游览在第一页上正常工作页面,但是当转到另一个页面时,它会出现问题并在下一页显示调试:
Bootstrap Tour 'tour' | 重定向到纸张/上传
Bootstrap Tour 'tour' | 错误重定向循环到纸张/上传
我已经在 chrome 的开发人员工具中检查了窗口本地存储,并在显示第二页窗口本地存储时看到它在正确的步骤上:tour_current_step value 2,
还有一个问题,我应该如何在 yii2 路由器的引导程序中设置路径选项的值,我的路径是否正确?例如第一步在网站的主页上是:“”,是否正确,我想如果有人点击popover的上一个按钮返回上一步。
这是我的 javascript 代码,我在布局文件中注册了这个 javascript 代码:
$(function() {
var $demo, duration, remaining, tour;
$demo = $("#demo");
duration = 5000;
remaining = duration;
tour = new Tour({
onStart: function() {
return $demo.addClass("disabled", true);
},
onEnd: function() {
return $demo.removeClass("disabled", true);
},
debug: true,
steps: [
{
path: "",
element: "#demo",
placement: "bottom",
title: "Welcome to Bootstrap Tour!",
content: "Introduce new users to your product by walking them through it step by step."
}, {
path: "",
element: "#Wordcounter",
placement: "bottom",
title: "Step One",
content: "For translation click on word counter menu item"
}, {
path: "paper/upload",
element: "#myDropzone",
placement: "top",
title: "Step two",
content: "Drag and Drop your file here or click to upload plz wate to complete upload"
}
,
{
path: "paper/upload",
element: "#next",
placement: "bottom",
title: "Step three",
content: "then Click on the Next Bottom",
reflex: true
}, {
path: "paper/show",
element: "#save",
placement: "top",
title: "Step four",
content: "click on save and continue and choose language plan",
duration: 5000
}
]
}).init();
if (tour.ended()) {
$('<div class="alert alert-info alert-dismissable"><button class="close" data-dismiss="alert" aria-hidden="true">×</button>You ended the demo tour. <a href="#" data-demo>Restart the demo tour.</a></div>').prependTo(".content").alert();
}
$(document).on("click", "[data-demo]", function(e) {
e.preventDefault();
if ($(this).hasClass("disabled")) {
return;
}
tour.restart();
return $(".alert").alert("close");
});
});