We are on the page http://site.com/movies/#posters
<div class="content">
<div id="posters"></div>
</div>
I'm trying to use this code, for jump to block with id posters
and add class active
to it:
$(location.hash).addClass("active");
It works good, but has a problem. If there is a link like <a href="http://site.com/movies/actuale/#posters">Actuale</a>
, it jumps to this link, not to <div id="posters"></div>
Should jump to block with id="posters
inside class="content"
block.
<div id="posters"></div>
should become <div class="active" id="posters"></div>
How to do that?
Thanks.