i18n属性应该是一个对象,并且应该位于教程的顶层。
我正在为该网站设置领英之旅。http://linkedin.github.io/hopscotch/它运行良好。但我需要更改已完成按钮的文本。一旦我放入下面的行i18n.doneBtn,就会出现静态页面,但动态执行停止,tour也不会出现。你对如何修复它有什么建议吗?谢谢
"fnInitComplete": function (){
$('#accessModal').modal('show');
{% if request.user.indTutorial %}
// Define the tour!
var tour = {
id: "hello-hopscotch-1",
steps: [
{
title: "View the Momentum Rankings",
content: "Algorithms analyze millions of data points to find the fastest growing companies in any industry.",
target: "tag-page-title",
width: 450,
placement: "bottom",
showCloseButton: true
},
{
title: "See momentum scores",
content: "Click on a company to understand the factors that drive their score.",
//target: "allResultTable",
target: document.querySelector(".sorting_1"),
placement: "bottom",
showCloseButton: true,
showPrevButton: true,
width: 450,
// the title of the done button - next
i18n.doneBtn: "Next"
}
],
onEnd: function() {
window.location.href = '/company/' + $('.my-row').attr('id');
}
};
它应该看起来像这样:
var tour = {
id: "hello-hopscotch-1",
steps: [
{
title: "View the Momentum Rankings",
content: "Algorithms analyze millions of data points to find the fastest growing companies in any industry.",
target: "tag-page-title",
width: 450,
placement: "bottom",
showCloseButton: true
},
{
title: "See momentum scores",
content: "Click on a company to understand the factors that drive their score.",
//target: "allResultTable",
target: document.querySelector(".sorting_1"),
placement: "bottom",
showCloseButton: true,
showPrevButton: true,
width: 450,
}
],
onEnd: function() {
window.location.href = '/company/' + $('.my-row').attr('id');
},
i18n: {
// the title of the done button - next
doneBtn: "Next"
}
};