and basically, i was going through the explanations of what each event meant, and to be honest, they all seemed the same to me. I hardly see any real difference between all the following:
On the screenX, and screenY:
Code:
function coordinates()
{
x=event.screenX
y=event.screenY
alert("X=" + x + " Y=" + y)
}
On the clientX, and clientY:
Code:
function show_coords()
{
x=event.clientX
y=event.clientY
alert("X coords: " + x + ", Y coords: " + y)
}
On the X, and Y, coordinates:
Code:
function coordinates()
{
x=event.x
y=event.y
alert("X=" + x + " Y=" + y)
}
The offsetX, and offsetY, coordinates:
Code:
function coordinates()
{
x=event.offsetX
y=event.offsetY
alert("Horizontal=" + x + " Vertical=" + y)
}
To be perfectly honest, they all seemed to report the same thing when you put any of the codes in an actual page. I didnt see any difference really between any of the above, other than, they had different names.
some are Moz only, some are IE only. not sure where standards come in (use object detection and you'll be fine). some pertain to position in relation to window, whilst others relate to position in relation to containing element.
Some of those events are specific to the browser window while others are specific to the document, test them and then scroll the page down a ways and test them again to see the difference.
__________________
Check out the Forum Search. It's the short path to getting great results from this forum.
some are Moz only, some are IE only. not sure where standards come in (use object detection and you'll be fine). some pertain to position in relation to window, whilst others relate to position in relation to containing element.
Quote:
from Roy
Some of those events are specific to the browser window while others are specific to the document, test them and then scroll the page down a ways and test them again to see the difference.
I dont "suppose" either of you could point to links that would make a comparison distinction between the 2?
As i said, i got most of the codes from the W3scools website. They didnt go too in depth in the differences between the 2 main browsers.
clientX Mouse pointer X coordinate relative to window
clientY Mouse pointer Y coordinate relative to window
offsetX Mouse pointer X coordinate relative to element that fired the event
offsetY Mouse pointer Y coordinate relative to element that fired the event
I checked out the site. Wasnt bad. The only real difference that i found was that offSet works in relation to the over-all area of something like a block, or a layer, and i would presume, a table. Here's the example used:
It didnt much talk about x, y, and screenY, and screenX. If either of the aforementioned properties relate to anything other than IE, it was not stated on the link given.
There was another example though that sort of confused me. There was one example that tried to juxstapose the difference between clientX, and offSetX, but from what i saw, neither really differed from the other. One would have thought that the minute one stepped outside the bounding box, that the coordinate registration would stop for one property, but not for the other. This wasnt the case though. Even when i made circles with the cursor in the area outside the blue box, the status window still reflected changes in the messages associated with a particular property. I found that odd.
It didnt much talk about x, y, and screenY, and screenX. If either of the aforementioned properties relate to anything other than IE, it was not stated on the link given.
these are Netscape-only properties. i would point you to Devedge, but as well know, those AOL twats removed it. you could always google tho*