Jquery步骤 - >按钮点击 - >转到步骤

时间:2013-12-21 17:27:22

标签: jquery wizard jquery-steps

我在asp.net应用程序中使用jquery steps向导。 单击按钮时,我有更改步骤的事件的问题。 在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!

问:按钮点击时如何调用函数来改变步骤索引?

2 个答案:

答案 0 :(得分:4)

我认为此插件不支持您当前使用的功能。这是插件中的代码

/**
 * 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!");
};

答案 1 :(得分:3)

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

$(本).steps( “前”);

$(本).steps( “下一个”);