jquery.validate - fade out highlight/unhighlight valid classes after time period
Hello,
I am using jquery-validate 1.16.0 with query 1.12.4 and jquery-migrate 1.4.1 and am wondering if someone can please help me. Disclaimer: I am not a programmer so please go easy on me :)
I have got a nice highlight/unhighlight function happening to either add/remove the error/valid classes on the grandparent div of checkboxes as well as on the text inputs. This works nicely at the moment and can be seen below:
- highlight: function (element,errorClass,validClass) {
var options = $(element).parents('.row.options');
if (options.length) {
options.addClass('options-error').removeClass('valid');
} else {
$(element).addClass('error').removeClass('valid2');
}
},
unhighlight: function (element,errorClass,validClass) {
var options = $(element).parents('.row.options');
if (options.length) {
options.addClass('valid').removeClass('options-error');
} else {
$(element).addClass('valid2').removeClass('error');
}
},
I have got a fiddle setup
here.
Is there a way to remove (fade out would be nice if possible) the valid / valid 2 classes set by the highlight/unhighlight functions after a time period, say 3 seconds?
Any ideas?
Thanks for any help.