PDA

View Full Version : Is it possible to create


`Anon
03-23-2003, 03:20 PM
it is possible to create a menu similiar to the one on this site but instead of having a role over image just a changing background on the TD?

URL removed by admin

I want to reduce the loading time on my site by not having to load a roll over image.

Thanks in advance
Anonymity.

brothercake
03-23-2003, 06:22 PM
You can do it with pure CSS:

td { background-color:#eaeaff; }
td:hover { background-color:#eaeaff; }

That won't work in IE though, but you can acheive the same thing by attaching a DHTML behavior. Something like this, in an external file called "hover.htc":

<public:component>

<attach event="onmouseover" handler="hilight" />
<attach event="onmouseout" handler="lolight" />

<script type="text/javascript">

function hilight() {
element.style.backgroundColor = "#eaeaff";
}

function lolight() {
element.style.backgroundColor = "#dfdfef";
}

</script>

</public:component>

Which you also apply through CSS:

td { behavior:url(hover.htc); }