Use anchor to display div
Posted
by scatteredbomb
on Stack Overflow
See other posts from Stack Overflow
or by scatteredbomb
Published on 2010-05-17T11:33:54Z
Indexed on
2010/05/17
11:40 UTC
Read the original article
Hit count: 330
I'm using jquery, and need to accomplish a couple things.
1) When someone clicks on a link (or in my case, a div) to display another div, I'd like to add an anchor to the url.
So, if someone clicks on a "Live" link, the 'live' div slides down, and we append #live to the url.
2) If someone visits that page and keeps the #live anchor at the end of the url, then the 'live' div should be visible right away.
I know how to handle the basic part of slideDown() if someone clicks a div. I don't know how to append the hashtag, or make it so that when the page is loaded that hashtag is checked and displays the respective div.
Any help understanding this would be appreciated. Thanks in advance.
© Stack Overflow or respective owner