780Part IIIDocument Objects ReferenceclientXclientYlayerXlayerYpageXpageYscreenXscreenYValue:Integer.Read-OnlyCompatibility:WinIE4+, MacIE4+, NN6+, Moz1+, Safari1+ (Free web design)
January 2nd, 2008780Part IIIDocument Objects ReferenceclientXclientYlayerXlayerYpageXpageYscreenXscreenYValue:Integer.Read-OnlyCompatibility:WinIE4+, MacIE4+, NN6+, Moz1+, Safari1+ The W3C DOM eventobject borrows mouse coordinate properties from both the NN4 andIE4+ event models. If you have worked with event coordinates in these other browsers, youhave nothing new to learn for W3C DOM-compatible browsers. Like the IE4+ eventobject, the W3C DOM eventobject s clientXand clientYpropertiesare the coordinates within the viewable content region of the window. These values are rela- tive to the window space, not the document. But unlike IE4+, you don t have to calculate theposition of the coordinates within the document because another pair of NN/Moz/Safari prop- erties, pageXand pageY, provide that information automatically. If the page has not scrolled, the values of the client and page coordinates are the same. Because it is usually more impor- tant to know an event s coordinates with respect to the document than the window, thepageXand pageYproperties are used most often. Another NN/Moz/Safari property pair, layerXand layerY, borrow terminology from the nowdefunct layer schemes of NN4, but the properties can still be quite valuable nonetheless. These coordinates are measured relative to the positioning context of the element thatreceived the event. For regular, unpositioned elements in the bodypart of a document, thatpositioning context is the bodyelement. Thus, for those elements, the values of the page andlayer coordinates will be the same. But if you create a positioned element, the coordinatespace is measured from the top-left corner of that space. Thus, if you are using the coordi- nates to assist in scripted dragging of positioned elements, you can confine your scope tojust the positioned element. One coordinate system missing from the NN6+/Moz repertoire, but present in Safari, is that ofthe target element itself (comparable to the offsetXand offsetYproperties of IE4+). Thesevalues, however, can be calculated in NN/Moz by subtracting from the page coordinate prop- erties the offsetLeftand offsetTopproperties of both the target element and its position- ing context. For example, if you want to get the coordinates of a mouse event inside an image, the event handler can calculate those values as follows: var clickOffsetX = evt.pageX - evt.target.offsetLeft document.body.offsetLeft; var clickOffsetY = evt.pageY - evt.target.offsetTop document.body.offsetTop; The last set of coordinate properties, screenXand screenY, provide values relative to theentire video display. Of all these properties, only the client and screen coordinates aredefined in the W3C DOM Level 2 standard. (NN6/Moz/Safari) eventObject.clientX
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.