我正在使用jQuery 步骤,一切似乎都在工作,除了我想为所有步骤设置一个完成/保存按钮并执行不同的操作。尽管根据其文档, OnFinishing 事件将 currentIndex 作为其参数,但它看起来并没有被设置,并且当我调试代码时它总是未定义。我在设置中有什么遗漏吗?
$("#wizard").steps({
/* Appearance */
bodyTag: "section",
stepsOrientation: 1,//vertical
showFinishButtonAlways: true,
/* Behaviour */
enableAllSteps: true,
saveState: true,
/* Events */
onStepChanging: function (event, currentIndex, newIndex) {
return true;
},
onStepChanged: function (event, currentIndex, priorIndex) { },
onFinishing: function (event, currentIndex) {
console.log(currentIndex);
},
onFinished: function (event, currentIndex) {
console.log(currentIndex);
},
/* Labels */
labels: {
current: "current step:",
pagination: "Pagination",
finish: "Save",
next: "Next",
previous: "Previous",
loading: "Loading ..."
}
});