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

问题描述 投票:1回答:2

我正在使用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!

问:单击按钮时调用函数如何更改步骤索引?

jquery wizard jquery-steps
2个回答
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!");
};

4
投票

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

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

 $(this).steps("next");
© www.soinside.com 2019 - 2024. All rights reserved.