我正在使用jQuery steps,一切似乎都在工作,除了我想为所有步骤设置一个Finish / Save按钮并执行不同的操作。虽然根据它的documentation,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 ..."
}
});