Created
January 8, 2013 22:06
-
-
Save oliver-montes/4488424 to your computer and use it in GitHub Desktop.
Compruebo si el Select no esta hidden, si lo esta oculto el DIV que utiliza el plugin jQuery.uniform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function(){ | |
// Start uniForm | |
jQuery("select, input:radio, input:checkbox").uniform(); | |
updateSelect(); | |
//solo compruebo si el select cambia | |
jQuery("select").change(function(){ updateSelect(); }); | |
function updateSelect() | |
{ | |
//dentro del objeto uniform me devuelve solo los elementos que tiene | |
var arrayFormElements = jQuery.uniform.elements; | |
for (var i = 0; i < arrayFormElements.length; i++) | |
{ | |
if(jQuery(arrayFormElements[i]).is(":hidden")) | |
{ | |
//si el elemento no es visible reseteo el elemento | |
jQuery.uniform.restore(arrayFormElements[i]); | |
}else{ | |
//si el elemento si es visible vuelvo a inicializar el elemento | |
jQuery("select").uniform(); | |
} | |
}; | |
} | |
// End uniForm | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment