2

我在 asp.net 应用程序中使用jquery 步骤向导。单击按钮时更改步骤的事件有问题。在 file.js 中初始化步骤

var WizardFunc = function () {
    var wizard = null;
    return {
        WizardSet: function () {
            wizard = $('#order').steps({
                bodyTag: "fieldset",
                transitionEffect: "slideLeft",
                headerTag: "h1",
                autoFocus: true
            });
        },
        WizardStepAdd: function (index, title, contentId) {
            wizard.steps("insert", index, {
                title: title,
                content: "<div id='" + contentId + "'></div>"
            });
        },
        WizardGoToStep: function (index) {
            wizard.steps("setStep", 1);
        },
        WizardStepRemove: function (index) {
            wizard.remove(index);
        }
    }
}();

我尝试调用函数:

$("#new-size-container").on("click", ".add-size", function () { 
WizardFunc.WizardGoToStep(1);}

返回错误:

Not yet implemented!

Q:点击按钮时如何调用函数来改变步数?

4

2 回答 2

5

对于任何来到这个未解决的旧帖子的人,请注意这个插件能够动态导航到步骤(下一个或上一个),如下所述:http ://www.rafaelstaib.com/category/jQuery-Steps

 $(this).steps("previous");

或者

 $(this).steps("next");
于 2015-07-27T09:48:44.943 回答
4

I think this plugin does not support the features you are currently using. Here is the code from plugin

/**
 * Sets a specific step object by index.
 *
 * @method setStep
 * @param index {Integer} An integer that belongs to the position of a step
 * @param step {Object} The step object to change
 **/
$.fn.steps.setStep = function (index, step)
{
    throw new Error("Not yet implemented!");
};

/**
 * Skips an certain amount of steps.
 *
 * @method skip
 * @param count {Integer} The amount of steps that should be skipped
 * @return {Boolean} Indicates whether the action executed
 **/
$.fn.steps.skip = function (count)
{
    throw new Error("Not yet implemented!");
};
于 2013-12-21T19:26:22.280 回答