Saturday, 7 September 2013

jQuery - multiple step wizard form

jQuery - multiple step wizard form

I have a simple wizard form that navigates through steps. I know there are
plenty of plugins out there but I just like to make my own.
I have a problem with the >> button that is supposed to display the next
step.
var current = $('.pg-wrapper div').hasClass('current');
var index = $('.pg-wrapper').index(current);
$(function () {
$('.pg-wrapper div').not('.current').hide();
}(jQuery));
$('#next').on('click', function() {
current.next().addClass('current');
current.removeClass('current');
});
Here is the full sample JS BIN

No comments:

Post a Comment