Skip to content

Instantly share code, notes, and snippets.

@fredyfx
Created November 10, 2017 01:26
Show Gist options
  • Save fredyfx/ca48b502e4b1b922248e02696fa595cc to your computer and use it in GitHub Desktop.
Save fredyfx/ca48b502e4b1b922248e02696fa595cc to your computer and use it in GitHub Desktop.
usando jquery hacemos una animación sencilla resaltando en rojo el borde de la caja de texto donde debemos ingresar información
var contieneValor = ($("#IdDelCampo").val().length > 0);
// si el valor es nulo, dará cero, por lo que será falso
//aquí lo mandamos a verdadero o hacemos un contieneValor == false que viene a ser lo mismo.
if(!contieneValor){
resaltarCampo();
}
function resaltarCampo() {
$("#IdDelCampo").css("border-color", "red");
setTimeout(function () {
$("#IdDelCampo").animate({ borderColor: "blue" }, { duration: 1500 });
}, 1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment