By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,848 Members | 3,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,848 IT Pros & Developers. It's quick & easy.

Events problems

P: n/a
Hello,

Context :

Dom Structure

DIV
|->TABLE
|->TR
|->TD
| |->textNode
|
|->TD
| |->IMG
|
|->TD
|->textNode

I have added mouseover and mouseout events on the DIV element.

I need thoses events only triggered when the mouse goes in and out of
the div but actually (with IE7) they are triggered if the mouse going
out of a Table cell to go in the adjacent cell.

I suppose a propagation pb but I don't know how to limit the event
attachement to the div only without any propagation to enbedded objects.

Thanks

Best regards

Niko
Oct 23 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Thu, 23 Oct 2008 14:50:20 +0200, Niko <ni*************@network.fr>
wrote:
Hello,

Context :

Dom Structure

DIV
|->TABLE
|->TR
|->TD
| |->textNode
|
|->TD
| |->IMG
|
|->TD
|->textNode

I have added mouseover and mouseout events on the DIV element.

I need thoses events only triggered when the mouse goes in and out of
the div but actually (with IE7) they are triggered if the mouse going
out of a Table cell to go in the adjacent cell.

I suppose a propagation pb but I don't know how to limit the event
attachement to the div only without any propagation to enbedded objects.
Pretty well explained:
http://www.quirksmode.org/js/events_mouse.html
--
Rik
Oct 23 '08 #2

P: n/a
On Oct 23, 2:50*pm, Niko <niko_enlever...@network.frwrote:
Hello,

Context :

Dom Structure

DIV
* |->TABLE
* * * *|->TR
* * * * * *|->TD
* * * * * | * |->textNode * *
* * * * * *|
* * * * * *|->TD
* * * * * | * |->IMG
* * * * * *|
* * * * * *|->TD
* * * * * * * |->textNode

I have added mouseover and mouseout events on the DIV element.

I need thoses events only triggered when the mouse goes in and out of
the div but actually (with IE7) they are triggered if the mouse going
out of a Table cell to go in the adjacent cell.

I suppose a propagation pb but I don't know how to limit the event
attachement to the div only without any propagation to enbedded objects.

Thanks

Best regards

Niko
div.onmouseover= function (event) {
var event= event || window.event;
if (event.target !== this) { return; }
//DoYourThingsHere
}

But, ISTM that IE's 'event' object lacks a 'target' property (?) so...
somebody else may want help you better than I.

--
Jorge.
Oct 23 '08 #3

P: n/a
On Oct 23, 7:52*am, Jorge <jo...@jorgechamorro.comwrote:
On Oct 23, 2:50*pm, Niko <niko_enlever...@network.frwrote:
Hello,
Context :
Dom Structure
DIV
* |->TABLE
* * * *|->TR
* * * * * *|->TD
* * * * * | * |->textNode * *
* * * * * *|
* * * * * *|->TD
* * * * * | * |->IMG
* * * * * *|
* * * * * *|->TD
* * * * * * * |->textNode
I have added mouseover and mouseout events on the DIV element.
I need thoses events only triggered when the mouse goes in and out of
the div but actually (with IE7) they are triggered if the mouse going
out of a Table cell to go in the adjacent cell.
I suppose a propagation pb but I don't know how to limit the event
attachement to the div only without any propagation to enbedded objects..
Thanks
Best regards
Niko

div.onmouseover= function (event) {
* var event= event || window.event;
* if (event.target !== this) { return; }
* //DoYourThingsHere

}

But, ISTM that IE's 'event' object lacks a 'target' property (?) so...
somebody else may want help you better than I.
IE sets the srcElement property.

div.onmouseover= function (event) {
var event = event || window.event;
var targ = event.target || event.srcElement;
if (targ !== this) { return; }
//DoYourThingsHere
}

Oct 23 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.