app.js optimisations.

This commit is contained in:
François Robichet 2011-05-17 16:28:03 -07:00
parent 25e93dba69
commit 681ff2e1cf

View File

@ -15,11 +15,11 @@ $(document).ready(function() {
tabs.each(function(i) {
//Get all tabs
var tab = $(this).children('li').children('a');
var tab = $(this).find('a');
tab.click(function(e) {
//Get Location of tab's content
var contentLocation = $(this).attr("href") + "Tab";
var contentLocation = this.href + "Tab";
//Let go if not a hashed one
if(contentLocation.charAt(0)=="#") {
@ -31,8 +31,7 @@ $(document).ready(function() {
$(this).addClass('active');
//Show Tab Content
$(contentLocation).parent('.tabs-content').children('li').hide();
$(contentLocation).show();
$(contentLocation).show().siblings().hide();
}
});