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