Forum Moderators: not2easy

Message Too Old, No Replies

I found a strange rollover

how/why does it work?

         

Purple Martin

11:39 pm on May 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've been asked to make some minor text changes to an existing page. It's got a strange rollover for the left menu that I haven't seen before. I know it doesn't validate, so how/why does it work?

<td bgcolor="#CC6600" onMouseOver=style.background="#A64514" onMouseOut=style.background="#CC6600">

D_Blackwell

11:47 pm on May 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might ask about this over in the Javascript forum. They'll know all about it.

Sargant

11:50 pm on May 3, 2004 (gmt 0)

10+ Year Member



Strictly, that shouldn't work. The browser is probably interpreting it as if with quotes though:

<td bgcolor="#CC6600" onMouseOver='style.background="#A64514"' onMouseOut='style.background="#CC6600"'>

Purple Martin

12:00 am on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah - mangled JavaScript. Thanks guys that makes sense now.

encyclo

12:04 am on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can also do something like this:

<td onmouseover="this.style.backgroundColor='#ffcc99';" onmouseout="this.style.backgroundColor='#ffffff';" onclick="location.href='index.html';" style="cursor:hand;">TD as a link</td>

It's a javascript/CSS combo, as D_Blackwell mentioned, rather than pure CSS.