Skip to content

Instantly share code, notes, and snippets.

@kaiquewdev
Created June 28, 2011 03:11
Show Gist options
  • Save kaiquewdev/1050407 to your computer and use it in GitHub Desktop.
Save kaiquewdev/1050407 to your computer and use it in GitHub Desktop.
Controle de abas
/*
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