?
Solved

onMouseOut Problem

Posted on 2005-04-08
12
Medium Priority
?
356 Views
Last Modified: 2012-05-05
Can anybody please tell me how NOT to trigger onMouseOut when going from one cell of the table to the next in the following code?

<p>
<center>
<div onMouseOut="alert('Out of bounds!')">

<table border=1 width=200>
<tr>
<td align=center>Title
<tr>
<td height=150 align=center valign=middle>body of the table
</table>
</div>
</center>

I want it to trigger only after the cursor exits the ENTIRE <div> or table.

Thanks!
0
Comment
Question by:limva
  • 6
  • 3
  • 3
12 Comments
 
LVL 16

Expert Comment

by:ellandrd
ID: 13734454


<table border="1" width="2002>
<tr>
<td align="center2>Title</td>
</tr>
<tr>
<td height="150" align="center" valign="middle" onMouseOut="alert('Out of bounds!')">body of the table</td>
</tr>
</table>

0
 
LVL 16

Expert Comment

by:ellandrd
ID: 13734461
sorry it shouldnt say 2002 for table witdh, its a typo sorry!

Ellandrd
0
 
LVL 16

Expert Comment

by:ellandrd
ID: 13734467
where the last 2 replace that with "

so

<table border="1" width="200">
<tr>
<td align="center">Title</td>
</tr>
<tr>
<td height="150" align="center" valign="middle" onMouseOut="alert('Out of bounds!')">body of the table</td>
</tr>
</table>
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Expert Comment

by:lombardp
ID: 13734634
You could this workaround (should work also in <table> tag, if you want to remove DIV wrapper)

Replace:  <div onMouseOut="alert('Out of bounds!')">    With:

<div onMouseout="tim=window.setTimeout('alert(\'Out of bounds!\')',100)" onMouseover="window.clearTimeout(tim);">
0
 
LVL 16

Expert Comment

by:ellandrd
ID: 13735131
lombardp,

that alerts the user after a timeout? dont think thats what limva wants!

Ellandrd
0
 
LVL 9

Expert Comment

by:lombardp
ID: 13735563
Try to add that row, the onmouseover attribute reset the timeout.
This is a workaround for your problem, please try!
0
 
LVL 9

Expert Comment

by:lombardp
ID: 13735572
ONMOUSEOUT is fired whenever you change CELL in the table, but ONMOUSEOVER immediately cancel the timer.

Timer is not canceled only if you leave the table, exactly as you want.
0
 
LVL 16

Accepted Solution

by:
ellandrd earned 400 total points
ID: 13736901
quote:

"Can anybody please tell me how NOT to trigger onMouseOut when going from one cell of the table to the next in the following code"

limva wants to trigger onMouseOut when changing cells in a table,

The code that I provided does that:

<table border="1" width="200">
<tr>
     <td align="center" valign="middle" onMouseOut="alert(You are over the Title Cell!');">Title</td>
</tr>
<tr>
    <td height="150" align="center" valign="middle" onMouseOut="alert('Out of bounds!')">Body of the table</td>
</tr>
</table>

Ellandrd
0
 

Author Comment

by:limva
ID: 13736905
ellandrd's solution doesn't work for me because I needed the script to alert me whenever the mouse goes out of the WHOLE table, including the "title" cell.

lombardp's solution works though, so I'm giving lombardp the points.

Many thanks to both of you!
0
 
LVL 16

Expert Comment

by:ellandrd
ID: 13737131
"when going from one cell of the table to the next"

that dont say anywhere the whole table... very unfair, please in future, be a little more clearer

Ellandrd
0
 

Author Comment

by:limva
ID: 13737155
Ooops. I gave the points to ellandrd by mistake!  lombardp, please click here: http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21381737.html to get your points.  Sorry.
0
 

Author Comment

by:limva
ID: 13737196
ellendrd, I said, "Can anybody please tell me how NOT to trigger onMouseOut when going from one cell of the table to the next"

There were just 2 cells in my example.  Going from 1 cell to the next means going through EVERY cell in the table - the whole table :-)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question