jquery-steps
jquery-steps copied to clipboard
Get Total number of steps
How get Total number of steps i.e total count in current wizard ?? any method ??
I just started using this plugin and I really like it . I created this method to get the steps. Working for me so far...
function getTotalSteps(wizard)
{
var steps = getSteps(wizard);
var count = 1;
for (var i = 0 ; i <= steps.length; i++)
{
count = count + 1;
}
return count;
}
After these lines in jquery.steps.js
$.fn.steps.skip = function (count)
{
throw new Error("Not yet implemented!");
};
Insert this snippet
/**
* Get number of steps in wizard
*
* @method getTotalSteps
* @return {Integer} Total Steps in Wizard
**/
$.fn.steps.getTotalSteps = function () {
var wizard = this;
var steps = getSteps(wizard);
return steps.length;
};
Usage: wizard.steps('getTotalSteps')