I have a javascript problem that I am needing some help with. I pulled the following code example (slighly modified) from a book and I am having some problems getting it to do what I am looking for.
-------------
<div id="menuFrame" class="menuFrame">
<table class="menuFrame" width="160" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="menuItem1" class="menuItem" onmouseover="this.style.backgroundColor = 'navy'; this.style.color = 'white';" onmouseout="this.style.backgroundColor = ''; this.style.color = 'black';">
<ilayer>
<layer id="menuItem1" class="menuItem" width="100%" onmouseover="this.bgColor = 'navy'; this.color = 'white';" onmouseout="this.bgColor = '#D4D0C8'; this.color = 'black';">
Menu Item 1
</layer>
</ilayer>
</td>
</tr>
</table>
</div>
-------------
I guess my first question is, could I not do this same thing using a pair of nested <div> tags and still have it work in all browsers - IE 4+, NS4, N6+??
Second, how do I go about referencing the inner layer when using NS4? I need to refer to it in a function and I have tried both:
document.layers.menuFrame.document.layers.menuItem1
document.menuFrame.document.menuItem1
and I am getting the standard "document.... has no properties" error message.
All help would be appreciated.
-- Jeff
-------------
<div id="menuFrame" class="menuFrame">
<table class="menuFrame" width="160" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="menuItem1" class="menuItem" onmouseover="this.style.backgroundColor = 'navy'; this.style.color = 'white';" onmouseout="this.style.backgroundColor = ''; this.style.color = 'black';">
<ilayer>
<layer id="menuItem1" class="menuItem" width="100%" onmouseover="this.bgColor = 'navy'; this.color = 'white';" onmouseout="this.bgColor = '#D4D0C8'; this.color = 'black';">
Menu Item 1
</layer>
</ilayer>
</td>
</tr>
</table>
</div>
-------------
I guess my first question is, could I not do this same thing using a pair of nested <div> tags and still have it work in all browsers - IE 4+, NS4, N6+??
Second, how do I go about referencing the inner layer when using NS4? I need to refer to it in a function and I have tried both:
document.layers.menuFrame.document.layers.menuItem1
document.menuFrame.document.menuItem1
and I am getting the standard "document.... has no properties" error message.
All help would be appreciated.
-- Jeff