[Javascript] Event question and finding pointer position at event

Triche Osborne wdlists at triche-osborne.com
Tue Mar 28 10:39:32 CST 2006


Bill Moseley wrote:
> [This was redirected from "thelist" at evolt.org -- sorry for those
> on both lists]
> 
> 
> I have two questions.  One is why events are firing when moving a
> mouse *within* a <div> when the events are on mouseover and mouseout on
> just the div . . .
> 

I have a theory about this. I noticed the same behavior while I was 
playing around with JS--not building a specific app, IIRC, just testing 
out possibilities for future reference. I meant to post a question about 
it, but got sidetracked into building some server-side applications for 
a client and forgot about it until Bill triggered the memory.
	Anyway I found the behavior puzzling, but I noticed one other thing 
about it that made me think about what was going on: The mouseover 
behavior fired whenever you moved the mouse within the DIV. As long as 
the mouse was still, nothing happened. If you moved it, it fired for 
each move. I'm thinking it means that "onmouseover" means quite 
literally what it says: Any time the mouse moves over the element, it 
fires. This implies movement *within* the element as well as over it's 
boundaries, which is more what I was hoping for.
	I could be wrong about this, and if so, I'm sure my JS elders and 
betters will correct me ;-), but it seems a logical assumption from the 
behavior I witnessed.

Triche Osborne




More information about the Javascript mailing list