Forum Moderators: open
<table id="layout">
<tr>
<td>
<a href="index.html"><div class="menu" onMouseOver="this.style.backgroundColor='navy';
this.style.border='2px inset black'" onMouseOut="this.style.backgroundColor='gray'; this.style.border='0px inset black'">Jobshop</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onMouseOver="this.style.backgroundColor='navy'; this.style.border='2px inset black'"
onMouseOut="this.style.backgroundColor='gray'; this.style.border='0px inset black'">Services</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onMouseOver="this.style.backgroundColor='navy'; this.style.border='2px inset black'"
onMouseOut="this.style.backgroundColor='gray'; this.style.border='0px inset black'">Products</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onMouseOver="this.style.backgroundColor='navy'; this.style.border='2px inset black'"
onMouseOut="this.style.backgroundColor='gray'; this.style.border='0px inset black'">Systems</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onMouseOver="this.style.backgroundColor='navy'; this.style.border='2px inset black'"
onMouseOut="this.style.backgroundColor='gray'; this.style.border='0px inset black'">Contact Us</div></a>
</td>
</tr>
</table>
HEEELLP
function mo(el) {
if ( selectEl ) { // unselect selected
selectEl.style.backgroundColor='gray';
selectEl.style.border='0px inset black';
}
selectEl = el; // new selected
el.style.backgroundColor='navy';
}
on each td
<td>
<a href="index.html"><div class="menu" onMouseOver="mo(this)">Products</div></a>
</td>
<html>
<head>
<script type="text/javascript">
var element = null;
function select(xx)
{
if ( element ) {
element.style.backgroundColor='gray';
element.style.border='2px outset white';
}
element = xx;
xx.style.backgroundColor='navy';
xx.style.border='2px inset black';
// I was thinking about nullifying the onMouseOut command of the selected item so that it will stay selected when the mouse leaves the box. This command doen't seem to do it. Do you know of anything simmilar.
xx.onMouseOut='null'
}
function over(xx) {
xx.style.backgroundColor='navy';
xx.style.border='2px inset black';
}
function out(xx) {
xx.style.backgroundColor='gray';
xx.style.border='2px outset white';
}
</script>
</head>
<body>
<table id="layout">
<tr>
<td>
<a href="index.html"><div class="menu" onClick="select(this)" onMouseOver="over(this)"
onMouseOut="out(this)">Jobshop</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)" onMouseOver="over(this)"
onMouseOut="out(this)">Services</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)" onMouseOver="over(this)"
onMouseOut="out(this)">Products</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)" onMouseOver="over(this)"
onMouseOut="out(this)">Systems</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)" onMouseOver="over(this)" onMouseOut="out(this)">Contact
Us</div></a>
</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<script type="text/javascript">
var element = null;
function over(xx)
{
if ( element ) {
element.style.backgroundColor='gray';
element.style.border='2px outset white';
}
element = xx;
xx.style.backgroundColor='navy';
xx.style.border='2px inset black';
}
</script>
</head>
<body>
<table id="layout">
<tr>
<td>
<a href="index.html"><div class="menu" onClick="select(this)" onMouseOver="over(this)">Jobshop</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)" onMouseOver="over(this)">Services</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)" onMouseOver="over(this)">Products</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)" onMouseOver="over(this)">Systems</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)" onMouseOver="over(this)">Contact
Us</div></a>
</td>
</tr>
</table>
</body>
</html>
Not sure what extra needs to happen on onClick, Dont see need for onMouseout ?
<html>
<head><title>menu</title>
<script type="text/javascript">
var element = null;
function select(xx)
{
if ( element ) {
element.style.backgroundColor='gray';
element.style.border='2px outset white';
}
element = xx;
xx.style.backgroundColor='navy';
xx.style.border='2px inset white';
}
</script>
<style type="text/css">
a {text-decoration:none; color:white}
a:visited {color:white}
a:active {color:red}
a:hover {color:red}
table#lay_menu {width:100%; margin:0px}
table#lay_menu td {text-align:center; width:20%}
.menu {text-align:center; background-color:gray; border:2px outset white}
</style>
</head>
<body>
<table id="layout"
<tr>
<td>
<a href="job.html"><div class="menu" onClick="select(this)">Jobshop</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)">Services</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)">Products</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)">Systems</div></a>
</td>
<td>
<a href="index.html"><div class="menu" onClick="select(this)">Contact Us</div></a>
</td>
</tr>
</table>
</body>
</html>