Created
July 7, 2011 20:35
-
-
Save kaiquewdev/1070482 to your computer and use it in GitHub Desktop.
Selecionar objetos
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
/*Alternar opções*/ | |
function alternarOpt(menu, itens){ | |
/*Esconde os itens*/ | |
$(itens).css({visibility:"hidden"}); | |
$(menu).bind('click', function(){ | |
var item = $(menu).index(this); | |
var vItem = $(menu+':eq('+item+')').attr("value"); | |
$(itens).css({visibility:"hidden"}); | |
$(itens+'#'+vItem).css({visibility:"visible"}); | |
console.log(vItem); | |
}); | |
} | |
//Primeiro argumento:Select | |
//Segundo argumento:Div | |
alternarOpt('menuToSelect','ItemForModificate'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment