Skip to content

Instantly share code, notes, and snippets.

@jospoortvliet
Created October 19, 2016 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jospoortvliet/1caaf56452f417ad9c2b937125440386 to your computer and use it in GitHub Desktop.
Save jospoortvliet/1caaf56452f417ad9c2b937125440386 to your computer and use it in GitHub Desktop.
<script>
// open the collapsible item in the FAQ from the URL
$(document).ready(function(){
if(window.location.hash != "") {
$('a[href="' + window.location.hash + '"]').click();
}
});
// Open the collapsible item in the FAQ when clicked on a href
jQuery( 'li.faqinfo a' )
.click(function() {
do_the_click( this.href );
return false;
});
function do_the_click( url )
{
alert( url );
var hash = url.substring(url.indexOf('#')+1);
alert( hash );
$('a[href="#' + hash + '"]').click();
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment