Click to See Complete Forum and Search --> : Proper Use of event.cancelBubble?


TSeroogy
08-25-2003, 10:10 PM
Building a site that includes an image embedded in the cell of a table.

My Goal:
As the mouse passes over the image a popup menu appears next to the image. I have created this by writing an onmouseover function that identifies the image as the srcElement of the event and then moves a DIV to the desired position.

Problem:
The script works great as long as the image is not inside the <TABLE>. When the image is placed inside a table cell, the onmouseover event seems to be ignored, and the onmouseover function is not called.

When I place the onmouseover function call inside the <TD> table cell tag, the DIV is placed incorrectly. As it appears, the event.srcElement property seems to see the <BODY> as the source of the event.

I've tried using the cancelBubble property of the event object to try and capture the image as the srcElement, but it is my first use of this property, and I'm not at all sure that it's being applied properly.

BTW - Use of the cancelBubble property was inspired by a series of Event Handling articles written by Jon Perry and available on this site - http://www.webdevelopersjournal.com/articles/jsevents3/jsevents3.html.

As I've not yet succeeded, is there someone that can give me a hand with this problem?

Best regards,
TSEROOGY