'easy' CSS/JavaScript effect but not working!

  Limariami 22:05 09 Mar 05
Locked

Hi all

Please help.

I cannot see what I am doing wrong. I am trying to create a straightforward effect using JavaScript and CSS, whereby a menu option changes colour when the mouse hovers, then loads a new page when clicked.

BUT it does not work at all. It seems that the browser (opera 7.51) is not seeing the function. This is the message I get in teh browser JavaScript console.

Event thread: onmouseover
Error:
name: ReferenceError
message: Statement on line 1: Reference to undefined variable: No such variable 'focusTitle'
Backtrace:
In unknown script
focusTitle(2);
At unknown location
{event handler trampoline}

The relevant bits of my code are

function focusTitle(j)
{
var currEl = document.getElementById('Title' + j);
currEl.className = "nav2" ;
}


and

td height="100" width="150">
div id="Title1" class="nav1" onMouseOver="focusTitle(1)" onmouseout="defocusTitle(1)" onclick="loadPage(1)">111 /div>
div id="Title2" class="nav1" onMouseOver="focusTitle(2)" onmouseout="defocusTitle(2)" onclick="loadPage(2)">222 /div>
/td>

Any ideas appreciated. Thanks.

  Limariami 22:08 09 Mar 05

PS for some strange reason, I cannot see the less-than signs in the message I have just posted

This thread is now locked and can not be replied to.

Samsung Galaxy S8 review

1995-2015: How technology has changed the world in 20 years

This poetic animation about monsters is illustrated in a Van Gogh painterly style

How to get WWDC 2017 tickets