the piece of code shown below is working fine, except it looks a bit amateuristic to my opinion (made it myself 😛 ). I’m sure this can be much cleaner. So my question is how to combine those ‘hides’? Any other suggestions?
$('.login_inputbox').removeClass("register_inputbox_error login_inputbox_error").removeClass("register_inputbox_ok login_inputbox_ok");
validator.resetForm();
$(".btn-slide_login").removeClass("active_login");
$(".btn-slide_all").removeClass("active_all");
$('#fancybox-wrap').hide();
$('#fancybox-overlay').hide();
$('#panel_login').hide();
$('#panel_all').hide();
Thanks in advance for your help!
To combine the
.hide()statements you’d need a selector that applies to all four elements. You could do this:Or you could give those elements a common class:
Note also that your first line can be simplified by combining the
.removeClass()calls: