Skip to content

Instantly share code, notes, and snippets.

@oliver-montes
Created January 8, 2013 22:06
Show Gist options
  • Save oliver-montes/4488424 to your computer and use it in GitHub Desktop.
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
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