Skip to content

Instantly share code, notes, and snippets.

@aqualungdesign
Created June 19, 2012 14:07
Show Gist options
  • Save aqualungdesign/2954409 to your computer and use it in GitHub Desktop.
Save aqualungdesign/2954409 to your computer and use it in GitHub Desktop.
Jquery Tabs
$(function(){ // atalho para jquery
function tabs(origin,itemClass1,destiny,itemClass2){
$(origin).children().click(function(){
$(this).siblings().removeClass(itemClass1);
$(this).addClass(itemClass1);
var n = $(this).index();
var e = $(this).parent().siblings(destiny).children();
e.removeClass(itemClass2);
e.eq(n).addClass(itemClass2);
return false;
});
}
tabs("#thumbs", "selected", "#photos2", "selected"); //exemplo de chamada da funcao.
});
@thiagoolc
Copy link

vamo testar essa porra! Se ficar bom eu te dou uma estrelinha!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment