Jump to content

How To Make My Nav Break Gracefully With Js


chibineku
 Share

Recommended Posts

As a little extra touch, I would like to make my nav menu break in the absence of JavaScript so that instead of clicking the top level list items to open the menus (as it does at the moment, thanks to JS), in the absence of JavaScript, the top level list items instead revert to ordinary links to static pages which will do the job of the pull down menus. I'm not sure how, though. Perhaps by running a script onload that strips the top level menu items of their usual anchors? I would appreciate some design thoughts before I proceed with this idea. If anchors didn't wrap around the list item text, it would be easy enough to remove the node altogether, but I'm not sure if removing the first part of the anchor would remove the closing tag...

Link to comment
Share on other sites

Ah, 'tis cunning in its simplicity. I wonder if my brain is actually unlearning. Is that possible?

Link to comment
Share on other sites

Hm, that does work, except that it screws up a js function that runs onload, replacing a menu element for one with a different id, attracting the styling I want the current page tab to have. That wasn't English, never mind that. So, I might try something different: create alternate basic navigation and position it over the current click through one, and set its display to off onload. If JS is off, it'll appear, hiding the click thru. Thanks for the reply, though - I am aware that I am hogging the entire forum these last couple of weeks, but I am on a steep learning curve and I have time pressure, too. Your help is always appreciated :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...