Created
June 28, 2011 03:11
-
-
Save kaiquewdev/1050407 to your computer and use it in GitHub Desktop.
Controle de abas
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
/* | |
nomeMenu = "Menu que sera selecionado", | |
item = "Item do menu que sera selecionado", | |
conteudo = "conteudo do menu que sera selecionado" | |
Teste URL: http://jsbin.com/ecitid/4 | |
*/ | |
function alternarAbas(nomeMenu,item,conteudo){ | |
var mElement = $(nomeMenu+" "+item); | |
$(conteudo).css({display:"none"}); | |
$(conteudo+":eq(0)").css({display:"block"}); | |
mElement.bind("click", function(){ | |
var numeroAba = mElement.index(this); | |
$(conteudo).css({display:"none"}); | |
$(conteudo+":eq("+numeroAba+")").css({display:"block"}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment