如果尚未满足页面上的条件(尝试使游览具有交互性),我试图阻止“下一步”按钮进入下一步。但是,我尝试的任何事情似乎都不会中断旅行的继续。
这方面的文档很少,所以搜索并没有真正产生任何有用的东西。我的步骤目前如下所示:
{
path: "/Product/Search",
title: "Try it!",
content: "Enter a brief search such as "camera" and pick an item from a list.",
placement: "top",
element: "form",
backdrop: "true",
onShow: function(t) {
$("div.form-actions").hide();
},
onNext: function (tour) {
var loc$ = $("#Search");
if (loc$.val() === '') {
alert('Enter a search term and pick a location.');
//Want something (anything) to cancel the click here
tour.setCurrentStep(tour.getCurrentStep() - 1);
} else {
//tour.next();
}
}
}