Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] ISO unobtrusive JS way to change body class
- From: mdougherty at pbp.com (Mike Dougherty)
- Subject: [Javascript] ISO unobtrusive JS way to change body class
- Date: Mon Mar 27 14:57:06 2006
Have you seen this:? http://www.htmldog.com/ptg/archives/000050.php On Mon, 27 Mar 2006 14:32:35 -0600 Scott Moore <moore.scott@xxxxxxxxx> wrote: > I'm working on a proof of concept for a navigation system and am in need of some help. At the >moment, I've got this code: > > <body class="first"> > <ul id="navmenu"> > <li id="first"><a href="#" onMouseover="document.body.className='first'">First Section</a></li> > <li id="second"><a href="#" onMouseover="document.body.className='second'">Second >Section</a></li> > <li id="third"><a href="#" onMouseover="document.body.className='third'">Third Section</a></li> > </ul> > > The idea is when you hover over an option, the JS changes the class of the body tag and the >associated sub-menu is displayed. However, when you roll off an option, the class of the body >tag doesn't return to it's original setting. Now for each section, I could create a separate >nav file and add onMouseout="document.body.className='current_section'" to each link, but >that's too messy and I want to have only 1 nav file. > > So with the intention of following the idea of unobtrusive JS, I don't believe I'm heading in >the right direction by using onMouseover. Can anyone point me in the direction I should be going >a cleaner solution? > > Scott > _______________________________________________ > Javascript mailing list > Javascript@xxxxxxxxxx > https://lists.LaTech.edu/mailman/listinfo/javascript > > > > __________________________________________________________ > This message was scanned by ATX > 3:33:17 PM ET - 3/27/2006
- References:
- [Javascript] ISO unobtrusive JS way to change body class
- From: Scott Moore
- [Javascript] ISO unobtrusive JS way to change body class
- Prev by Date: [Javascript] ISO unobtrusive JS way to change body class
- Next by Date: [Javascript] ISO unobtrusive JS way to change body class
- Previous by thread: [Javascript] ISO unobtrusive JS way to change body class
- Next by thread: [Javascript] ISO unobtrusive JS way to change body class
- Index(es):