- 0
[javascript] Use url hash to toggle div display
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
- 8 replies
- 2 views
-
Microsoft launches TypeScript 5.6 with a number of new improvements
By John Callaham,
- microsoft
- javascript
- (and 2 more)
- 1 reply
- 1 view
-
Free Download: Professional JavaScript for Web Developers eBook (worth $48)
By News Staff,
- ebook offer
- sponsored
- (and 2 more)
- 0 replies
- 1 view
-
Microsoft introduces TypeScript 5.5: Explore the latest features and enhancements
By zikalify,
- microsoft
- typescript
- (and 4 more)
- 0 replies
- 1 view
-
Free Offer: JavaScript Essentials for Dummies ($10 Value) eBook
By News Staff,
- ebook offer
- sponsored
- (and 2 more)
- 0 replies
- 1 view
-
Question
Syanide
So I have a simple page setup where clicking on various links will toggle their correspondent divs from sliding in and showing some info (hidden by default). It was important for me that clicking on a link would first slide out the currently visible one (if anything was clicked beforehand) before sliding in the next one. You can check the exact behavior, albeit different code example here: http://jsfiddle.net/b7C2d/1/
The problem I'm having now is that I can't figure out how to incorporate the url hash to make the div visible when the appropriate link is visited. In this example, if I open website.com/#panel-one, I would like the appropriate div to be shown, with the rest of the functionality the same as in the example above (if I click on the link titled "Two" I would like the currently visible one to slide out and panel-two to slide in).
Any help would be greatly appreciated.
Link to comment
https://www.neowin.net/forum/topic/1273456-javascript-use-url-hash-to-toggle-div-display/Share on other sites
6 answers to this question
Recommended Posts