diff --git a/examples/index.html b/examples/index.html index 0ddbfdd..068d7e1 100755 --- a/examples/index.html +++ b/examples/index.html @@ -95,6 +95,27 @@ return $( this ).wizard( "form" ).valid(); } }).wizard( "form" ).validate( validate ); + + // Example 6: Dynamically add steps to the wizard + var $example6 = $( "#example-6" ).wizard(); + + $example6.find( "[name=e6-howMany]" ).on( "change", function() { + var $this = $( this ); + var howMany = $this.val(); + + // Remove previously added dynamic steps + $example6.find( ".step.dynamic" ).remove(); + + // Add in selected number of steps + for (var i = 0, l = howMany; i < howMany; i++) { + $example6.find( ".steps" ).append( + $( "