Bones/javascripts/tabs.js

26 lines
708 B
JavaScript
Raw Normal View History

2011-08-17 21:37:35 -04:00
/*
* Skeleton V1.1
2011-08-17 21:37:35 -04:00
* Copyright 2011, Dave Gamache
* www.getskeleton.com
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
* 8/17/2011
2011-08-17 21:37:35 -04:00
*/
$('body').on('click', 'ul.tabs > li > a', function(e) {
//Get Location of tab's content
var contentLocation = $(this).attr('href');
//Let go if not a hashed one
if(contentLocation.charAt(0)=="#") {
e.preventDefault();
//Make Tab Active
$(this).parent().siblings().children('a').removeClass('active');
$(this).addClass('active');
//Show Tab Content & add active class
$(contentLocation).show().addClass('active').siblings().hide().removeClass('active');
}
2012-01-31 06:48:34 -05:00
});