Created
June 19, 2012 14:07
-
-
Save aqualungdesign/2954409 to your computer and use it in GitHub Desktop.
Jquery Tabs
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
$(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. | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vamo testar essa porra! Se ficar bom eu te dou uma estrelinha!