jQuery的步骤 - >按钮,单击 - >转到步骤(Jquery Steps ->bu

2019-10-19 03:51发布

我使用jQuery的步骤中asp.net应用程序向导。 我有一个事件问题更改步单击按钮时。 在file.js Initailize步骤

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!

问:如何调用函数改变阶跃折射率,当点击链接?

Answer 1:

我觉得这个插件不支持当前正在使用的功能。 下面是从插件代码

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


Answer 2:

For any person who are coming to this old unresolved post, please note that this plugin is able to navigate dynamically to step (next or previous) as described here : http://www.rafaelstaib.com/category/jQuery-Steps

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

or

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



文章来源: Jquery Steps ->button click->go to step