offsetXY clientXY screenXY pageXY

offsetX mouse coordinates relative to the upper left corner of the X-axis of the event source

offsetY mouse event coordinates relative to the source of the upper left corner of the Y-axis

screenX mouse coordinates relative to the display screen upper left corner of the x-axis;  

screenY mouse relative to the display screen upper left corner y coordinate axes;

clientX the mouse relative to the browser (here that is the effective area of ​​the browser) the coordinates of the upper left corner x-axis; scroll bar does not vary with changes;

clientY the mouse relative to the browser (here that is the effective area of ​​the browser) the upper left corner y coordinate axes; scroll bar does not vary with changes;

pageX the mouse relative to the browser (here that is the effective area of ​​the browser) the coordinates of the upper left corner x-axis; with the scroll bar is changed;

pageY the mouse relative to the browser (here that is the effective area of ​​the browser) the coordinates of the upper left corner of the y-axis; scrolling with the scroll bar is changed 

When the browser is no scroll bar (visible window overlaps with the document window), pageX and clientX equal, pageX equal clientY,

If Scroll down and appeared to pull down the scroll bar, the document window scroll up, if the scroll bar to slide around and appeared Scroll to the right, the document window to scroll to the left, in the case of the document window scrolling, pageX> = clientX, pageY> = clientY, x = clientX, y = clientY, 

 

offsetWidth and offsetHight, offsetTop and the offsetLeft
     . 1, the actual width offsetWidth

            offsetWidth = width + padding + left around boder

      2, the actual height of offsetHeith

                      offsetHeith = height + boder vertically down padding +

      3, offsetTop actual width

                       offsetTop: an outer edge of the frame to the nearest positioned parent distance (the offsetParent) the upper edge of the frame for the current element. If the parent

         Level are not positioned, respectively, is the distance from the top of the body and the left

      4, offsetLeft actual width

        offsetLeft: outside the left edge of the frame element nearest positioned to the left side of the box from the edge of the parent (offsetParent) current. If the parent level are not positioned, respectively, is the distance from the top of the body and the left

Guess you like

Origin www.cnblogs.com/zhanghaifeng123/p/12008269.html