2012-03-01 17:30:57 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Skeleton V1.1
|
|
|
|
* 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
|
|
|
|
2012-03-01 17:53:51 -05:00
|
|
|
(function ($) {
|
2012-03-01 17:38:50 -05:00
|
|
|
// hash change handler
|
|
|
|
function hashchange () {
|
|
|
|
var hash = window.location.hash
|
|
|
|
, el = $('ul.tabs [href*="' + hash + '"]')
|
2012-03-01 17:53:51 -05:00
|
|
|
, content = $(hash)
|
2011-08-17 21:37:35 -04:00
|
|
|
|
2012-03-01 17:53:51 -05:00
|
|
|
if (el.length && !el.hasClass('active') && content.length) {
|
|
|
|
el.closest('.tabs').find('.active').removeClass('active');
|
|
|
|
el.addClass('active');
|
|
|
|
content.show().addClass('active').siblings().hide().removeClass('active');
|
2012-03-01 17:33:42 -05:00
|
|
|
}
|
2012-03-01 17:38:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// listen on event and fire right away
|
|
|
|
$(window).on('hashchange.skeleton', hashchange);
|
|
|
|
hashchange();
|
2012-03-01 17:53:51 -05:00
|
|
|
$(hashchange);
|
|
|
|
})(jQuery);
|