fade away resolved error messages on questions
This commit is contained in:
@ -1,17 +1,29 @@
|
||||
var $textInput = $('[type="color"], [type="date"], [type="datetime"], [type="datetime-local"], [type="email"], [type="month"], [type="number"], [type="password"], [type="search"], [type="tel"], [type="text"], [type="time"], [type="url"], [type="week"], input:not([type]), textarea');
|
||||
|
||||
// Text Input Label Animation
|
||||
|
||||
var textInput = $('[type="color"], [type="date"], [type="datetime"], [type="datetime-local"], [type="email"], [type="month"], [type="number"], [type="password"], [type="search"], [type="tel"], [type="text"], [type="time"], [type="url"], [type="week"], input:not([type]), textarea');
|
||||
|
||||
textInput.prev('label').addClass('loaded');
|
||||
$(textInput).each(function() {
|
||||
$textInput.prev('label').addClass('loaded');
|
||||
$textInput.each(function() {
|
||||
if( $(this).val() ) {
|
||||
$(this).prev('label').addClass('animate');
|
||||
}
|
||||
});
|
||||
$(textInput).on('focus', function() {
|
||||
$textInput.on('focus', function() {
|
||||
$(this).prev('label').addClass('animate');
|
||||
}).on('focusout', function() {
|
||||
if( !$(this).val() ) {
|
||||
$(this).prev('label').removeClass('animate');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// form error resolutions
|
||||
$('form').has('.error').each(function(){
|
||||
var $form = $(this);
|
||||
|
||||
$form.on('keyup', $textInput, function(){
|
||||
$form.find(".error").addClass('resolve-error');
|
||||
});
|
||||
|
||||
$form.on('change', $("[type=radio], [type=checkbox]"), function(){
|
||||
$form.find(".error").addClass('resolve-error');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user