jQuery if url hash, click event/activate javascript

Viewed 13168

So from the home page, i have a link that goes to a products listing page. The product page has expand/collapse divs.

I need the appropriate div to expand depending on what the url# is.

So the link on the homepage is

<a href="/out-products.php#healthysnacks">healthy snacks</a>

when i click the link above, i am trying to activate this, on the product page:

<a href="javascript:ReverseDisplay('products4')" id="healthysnacks"> Healthy Snacks</a>

I've tried some of the other codes that i found that trigger click by checking for hash tag and none of them were working properly, i think it's because of the ReverseDisplay js. Please any insight would help.

thanks

3 Answers
Related