I am using a jQuery-steps on my app to for a wizard-like situation. I am having trouble finding out how to change to a custom step though. Any help with this one?
Check my following implementation, What do you think guys?
$.fn.steps.setStep = function (step)
{
var currentIndex = $(this).steps('getCurrentIndex');
for(var i = 0; i < Math.abs(step - currentIndex); i++){
if(step > currentIndex) {
$(this).steps('next');
}
else{
$(this).steps('previous');
}
}
};
And you can execute the new method very easy:
$("#form").steps("setStep", 4); //based on 0 (set the index)
Regards, Nicholls
function GotoSpecificStep(action, currentStep, number) {
try
{
var stepsTogo = parseInt(currentStep) - parseInt(number);
for (i = 1; i <= Math.abs(parseInt(stepsTogo)) ; i++) {
if (action == "next") {
$(".btnNext").click();
}
else if (action == "prev") {
$(".btnPrevious").click();
}
}
}
catch(exception)
{
MsgBox(exception.message);
}
}
I did something like below to get it worked:
stepsWizard = $("#wizard").steps({
headerTag: "h2",
bodyTag: "section"
});
var indx = 3;
for (i = 0; i <= indx; i++) {
stepsWizard.steps("next");
}