Reputation: 411
How toggle class to specific html element if the hash e.g) equal #area & the id="Hafr"
i need to toggle
class="opened"
to this element
<div id="hafr"></div>
if the hash from the url = #area
please look for my submenu in jsfiddle! http://jsfiddle.net/samehsubscription/8u5qy/
Upvotes: 1
Views: 611
Reputation: 411
if (window.location.hash == '#area') $('#hafr').addClass('opened');
Thanx @abhitalks
Upvotes: 1