Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnMouseOut triggers incorrectly in nested table

Status
Not open for further replies.

mgoulet777

Programmer
Jul 6, 2005
2
US
Hi there. If you include an onmouseout command within a nested table, the code actually triggers when the pointer enters the cell. Check out this simplified code:

<table>
<tr>
<td>
<table><tr><td onmouseout="alert('Test')">Example Text</TD></TR></TABLE>
</td>
</tr>
</table>

This doesn't work properly. Anyone know why not?

Thanks!
 
Sorry, that code should be:

<table>
<tr>
<td onmouseout="alert('Test')">
<table><tr><td>Example Text</TD></TR></TABLE>
</td>
</tr>
</table>
 
You'll see why if you do this:
Code:
<table border="1" cellpadding="10">
 <tr>
  <td onmouseout="alert('Test')">
   <table border="1"><tr><td>Example Text</TD></TR></TABLE>
  </td>
 </tr>
</table>
When you move the mouse pointer "out" of the outer cell and into the inner table, the trigger fires. I don't know if this is how [tt]onmouseout[/tt] is supposed to work, but that's why it's happening.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top