Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Event question and finding pointer position at event
- From: moseley at hank.org (Bill Moseley)
- Subject: [Javascript] Event question and finding pointer position at event
- Date: Tue Mar 28 22:21:14 2006
Sorry for dragging this out... On Tue, Mar 28, 2006 at 02:55:00PM -0500, Steve Clay wrote: > Here was the page I should have referred to: > http://www.quirksmode.org/js/events_mouse.html#mouseover That's interesting. The method used there takes the element where the event came from and walks the DOM outward. If you find the node where the event happened then you know the event happened inside. If you come across "body" then you know you are leaving the menu layer (i.e. the event was not inside the layer): /* Now move up looking to see if current element is found */ while (reltg && reltg != tg && reltg.nodeName != 'BODY') { debug('looking at node <' + reltg.nodeName + '>' ); reltg = reltg.parentNode; } As things turn out, I'm not exactly seeing that. The first node I see (the relatedTarget) is "html", so "BODY" is never passed. I don't understand why it's not working like I expect. But testing for a null reltg (in addition to testing for "BODY") seems to work. http://hank.org/demos/menu3.html -- Bill Moseley moseley@xxxxxxxx
- References:
- [Javascript] Event question and finding pointer position at event
- From: Bill Moseley
- [Javascript] Event question and finding pointer position at event
- From: Triche Osborne
- [Javascript] Event question and finding pointer position at event
- From: Steve Clay
- [Javascript] Event question and finding pointer position at event
- From: Bill Moseley
- [Javascript] Event question and finding pointer position at event
- From: Steve Clay
- [Javascript] Event question and finding pointer position at event
- Prev by Date: [Javascript] TextNodes
- Next by Date: [Javascript] TextNodes
- Previous by thread: [Javascript] Event question and finding pointer position atevent
- Next by thread: [Javascript] TextNodes
- Index(es):