Skip to content

Instantly share code, notes, and snippets.

@AnnaCrumina
Forked from crumina/custom.js
Last active August 29, 2015 14:19
Show Gist options
  • Save AnnaCrumina/0b3764b61075bfa31521 to your computer and use it in GitHub Desktop.
Save AnnaCrumina/0b3764b61075bfa31521 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function () {
setTimeout(function() {
if (window.location.hash) {
jQuery('.accordion dd > a').each(function () {
var current = jQuery(this).parents('.accordion');
var hash = '#' + jQuery(this).attr('href').split('#')[1];
if (hash == window.location.hash) {
current.find('dd').removeClass('active');
current.find('.content').hide();
jQuery(this).parent().addClass('active');
jQuery(this).siblings('.content').show();
}
});
}
}, 100);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment