rstaib / jquery-steps

A powerful jQuery wizard plugin that supports accessibility and HTML5.
http://www.jquery-steps.com
MIT License
1.69k stars 782 forks source link

Show the current step only, on init #330

Closed elvisef closed 3 years ago

elvisef commented 3 years ago

Hello.

I am trying to do something like this:

onInit: function (event, currentIndex) { $(".steps > ul > li").hide(); $("#quiz_test-t-3").show(); },

Unfortunately (while it works in the browser), it does not not work in the function. It seems all steps (LI tags) are being loaded after initialization.

If I do a "hide" without "li", it works well with "ul" only. With ".steps" only it also works. It just does not work with all the steps. If I hide ".steps" I will have no possibility to unhide a certain step, because steps are children of the ".steps" element.

How to make it ?

elvisef commented 3 years ago

Alright, I did this by:

onStepChanged: function (event, currentIndex, priorIndex) { $(".steps > ul > li").hide(); $("#quiz_test-t-"+currentIndex).parent(\'li\').show(); }

elvisef commented 3 years ago

But still there's a problem with "onInit" because I need t ohave only the first step tab visible.... Is there a way ?