• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Expanding menu with current links (Jquery)

Akhen

Golden Member
I have been trying to make a very specific menu for a site for a while now and in my original pursuit it was recommended I use jQuery and with my already limited knowledge of Javascript I tried to put something together but I am getting more and more lost.

Basically I am trying to make a menu that can expand each separate section on mouse click as is currently setup here but additionally if the link matches the url it will highlight that link with the class "selected" and expand the section that contains it.

Here is what I have so far, which is bits and pieces of information I could gather and attempt to combine (obviously the auto highlight link wont work in this environment):

http://jsfiddle.net/qtYX3/7/

(remember to fork the jsFiddle before you make changes so that you get a new link instead of everyone editing the same one)

Thanks,

Akhen
 
Code:
var url = window.location.href   

````class.hide       
if(url.match("blah")  )                 {                
 jQuery('.blahclass').toggleClass('blah');

}
 
Back
Top