Search code examples
javascripttwitter-bootstrapwizardfuelux

FuelUX Wizard component - how to allow user to go directly to the last step?


FuelUX Wizard component - how to allow user to go directly to the last step??

I'm able work with FuelUX Wizard but my need is i want first and last button with next and previous.

i am trying this example

http://bootply.com/74471

any help on this please.


Solution

  • Here is an example to allow moving a wizard to the last step. This is presented as a utility function because the wizard itself doesn't (yet?) have this method.

    function wizardMoveLast($wizard) {
        var $steps = $wizard.find('.steps li');
        var currentStep = $steps.filter('.active').index() + 1;
        var distance = $steps.length - currentStep;
    
        for (var i = 0; i < distance; i++) {
            $wizard.wizard('next');
        }
    }
    
    wizardMoveLast($('#MyWizard'));