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