Bones/javascripts/app.js

34 lines
871 B
JavaScript
Raw Normal View History

2011-07-31 15:03:09 -04:00
/*
* Skeleton V1.0.3
* Copyright 2011, Dave Gamache
* www.getskeleton.com
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
* 7/17/2011
2011-07-31 15:03:09 -04:00
*/
/* Tabs Activiation
================================================= */
$('ul.tabs > li').live('click', function(e) {
var $tab = $(this);
var $href = $tab.find('a:first');
var $otherHrefs = $tab.siblings().find('a');
var contentLocation = $href.attr('href') + "Tab";
//Let go if not a hashed one
if(contentLocation[0]=="#") {
e.preventDefault();
$otherHrefs.removeClass('active');
//Make Tab Active
if (!$href.hasClass('active')){
$href.addClass('active');
}
//Show Tab Content & add active class
$(contentLocation).show().addClass('active').siblings().hide().removeClass('active');
}
2011-07-31 15:03:09 -04:00
});