- 0
[javascript] Use url hash to toggle div display
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Download HTML, CSS, & JavaScript All-in-One For Dummies ($39.99 Value, now FREE)
By News Staff,
- ebook offer
- sponsored
- (and 5 more)
- 0 replies
- 0 views
-
Microsoft is making TypeScript 10x faster for developers
By pradeepviswav,
- microsoft
- typescript
- (and 3 more)
- 4 replies
- 0 views
-
Microsoft introduces TypeScript 5.8: Explore the latest features and enhancements
By zikalify,
- microsoft
- typescript
- (and 4 more)
- 4 replies
- 0 views
-
- 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
- 2 views
-
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