Jquery Steps – >按钮单击 – >转到步骤
我在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: "" }); }, 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!
问:按钮点击时如何调用函数来改变步长索引?
我认为这个插件不支持您当前使用的function。 这是插件的代码
/** * 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!"); };
对于任何来到这个旧的未解决post的人,请注意此插件能够动态导航到步骤(下一个或上一个),如下所述: http : //www.rafaelstaib.com/category/jQuery-Steps
$(本).steps( “以前的”);
要么
$(本).steps( “下一步”);