Quote:
Originally Posted by Rsmastermind
Sorry to say but there is window.event in the firefox I had done and executed the code.The code written above by zaphod42 will work fine instead of the browser's behaviour.
I can personally assure you there is no window.event in firefox (unless you create one).
yes the code does work fine. thats because the firefox part doesn't use window.event but the intrinsic event argument, in this case named evt.
i know it's confusing, so lets break it down:
in the code:
-
mouseY=function(evt){
-
return(evt?(evt.pageY?evt.pageY:evt.clientY):(wind ow.event
-
it asks (evt?)
if yes ( an event object was passed to the function, as in firefox), it returns evt.pageY or evt.clientY.
if (evt?) results in no, it means no argument was passed, as in IE.
it then returns window.event.pageY or window.event.clientY
so to sum: ie uses the window.event part, and firefox uses the argument evt part.
i hope this helps shed some light on the two confusing event models.