raphael232
Programmer
Hi, I want to show a layer within a td tag when you hover over the td tag and hide it when you move out of the td tag. So far I have the following:
Here's my showLayer and hideLayer functions:
And here's my navigation style:
The trouble is that the layer is bigger than the td tag and i need it to overlap the sides so i added a z-index which works if you hover over the first row and then the second row but if you back to the first row the layer only fills the td again.
Appreciate if someone could help. I'm sure it's just a simple mistake in my login. Thanks
Code:
<tr>
<td hideLayer('Navigation1');" onclick="showLayer('Navigation1');">Test 1 <div onmouseover="showLayer('Navigation1')" id="Navigation1" onmouseout="hideLayer('Navigation1')" id="Navigation1" class="Navigation">
<a href="Edit.htm">Edit</a><br />
<a href="Delete.htm">Delete</a>
</div>
</td>
<td>Cat 1</td>
</tr>
<tr>
<td hideLayer('Navigation2');" onclick="showLayer('Navigation2');">Test 2 <div onmouseover="showLayer('Navigation2')" id="Navigation2" onmouseout="hideLayer('Navigation2')" id="Navigation2" class="Navigation">
<a href="/Default.htm">Edit Attributes</a><br />
<a href="/Default.htm">Edit Content</a><br />
<a href="/Default.htm">Delete</a>
</div>
</td>
<td>Cat 1</td>
</tr>
Here's my showLayer and hideLayer functions:
Code:
<script language="javascript">
function hideLayer(whichLayer) {
document.getElementById(whichLayer).style.zIndex = 0;
document.getElementById(whichLayer).style.visibility = 'hidden';
}
function showLayer(whichLayer) {
document.getElementById(whichLayer).style.zIndex = 1000;
document.getElementById(whichLayer).style.visibility = 'visible';
}
</script>
And here's my navigation style:
Code:
.Navigation {
position: absolute;
top: 0;
right: 0;
visibility: hidden;
width: 150px;
}
The trouble is that the layer is bigger than the td tag and i need it to overlap the sides so i added a z-index which works if you hover over the first row and then the second row but if you back to the first row the layer only fills the td again.
Appreciate if someone could help. I'm sure it's just a simple mistake in my login. Thanks