I have created a resources site that has multiple pages of content. Each page has 20-30 Bootstrap accordions. When clicked the accordions expand to display additional information about the given resource.
My goal is for the homepage to have "Featured Resources" that when clicked will navigate to the page and open the requested accordion. I'd like to use a # to navigate (site.com/page.html#featured-resource)
The following script allows me to navigate to the page using a hashtag and open the requested accordion, but does not actually scroll to that part of the page.
$(document).ready(function () {
location.hash && $(location.hash + '.collapse').collapse('show');
});
I would like for this to not only open the accordion, but to scroll to that part of the page as well. How would I make this happen?
Thanks!