View Single Post
Old 10-05-2007, 07:05 AM   #12 (permalink)
Boogle
Contributing Member
 
Join Date: 09-03-07
Location: England
Posts: 425
iTrader: 0 / 0%
Latest Blog:
None

Boogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the roughBoogle is a jewel in the rough
Costin, or anyone else ableto answer this!:

should this work?

Code:
function setMenuItem() { var currentPage = document.title; switch (currentPage) { case "Servicing": document.getElementById('Servicing').style.backgroundColor = '#D25A0B'; document.getElementById('Servicing').style.borderColor = '#D25A0B'; break; case "Who": //code break; } }
and calling the function on

Code:
<body onclick="setMenuItem()"> <div id="modernbricksmenu" style="width:801px;"> <ul> <li id="Home" style="margin-left: 1px;"><a href="#" title="Home">Home</a></li> <li id="Who" ><a href="Who.aspx" title="Who">Who Are We?</a></li> <li id="Servicing" ><a href="Servicing.aspx" title="Servicing">Servicing</a></li> <li id="ContactUs" ><a href="ContactUs.aspx" title="Forums">Contact Us</a></li> <li id="Forums" ><a href="http://www.swiftmobility.co.uk/forum/default.asp" title="Swift Forums">Forums</a></li> </ul> </div> </body>
I know the switch-case is working because i've put an alert("showmesage"); after the code for each case, so i know it's doing something on the onload method, however it's not setting the style properties like i've asked... any ides why?

Thanks again,

Boog's
__________________
Great new 'June' Javascript Framework

June Forums - Innovative JScripting

Price is what you pay... Value is what you get.
Boogle is offline   Reply With Quote