View Full Version : What is this?


niya429
12-28-2005, 06:24 PM
I'm working on a new layout and I want to know how I can do a navigation where the background of the link is higlighted upon hover - not just the link itself. An example of this can be found here: http://www.ewonline.net/

Any help would be appreciated. Thanks :)

Douglas
12-28-2005, 06:43 PM
Use tables, and onmouseover:


<script language="JavaScript" type="text/javascript">
<!--;
function changecolor(id) {
document.getElementById(id).style.background='#e5e 5e5';
}
function changeback(id) {
document.getElementById(id).style.background='#fff fff';
}
//-->
</script>

<table border="0" cellpadding="2" cellspacing="0">
<tr>
<td id="td1" onmouseover="javascript:changecolor('td1');" onmouseout="javascript:changeback('td1');"><a href="something.html">Link</a></td>
</tr>
<tr>
<td id="td2" onmouseover="javascript:changecolor('td2');" onmouseout="javascript:changeback('td2');"><a href="something2.html">Link</a></td>
</tr>
</table>


That will work ;)

niya429
12-28-2005, 10:02 PM
Yay!! Thank you so much. I really appreciate it :)

Douglas
12-28-2005, 10:13 PM
No problem ;)

djou
12-28-2005, 10:59 PM
I personally strongly advise you not to use Javascript. I am one of those who browse with it turned off.

I am in love with the Webmaster Toolkit CSS menu generator: http://www.webmaster-toolkit.com/css-menu-generator.shtml

niya429
12-28-2005, 11:55 PM
Okay, I'll check out the link. Thanks :)