Created
June 9, 2016 01:34
-
-
Save bluemango/12c91ea4ab8d41c51cf438d034f3d0b5 to your computer and use it in GitHub Desktop.
Expand foldable section.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function($) { | |
if (window.location.hash) { | |
var anchor = window.location.hash; | |
var el = $(anchor); | |
var parents = $(el).parents('.nested-article'); | |
$(parents).show(); | |
$(parents).prev().addClass('expanded'); | |
location.hash = null; | |
location.hash = anchor; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment