[JS/Jquery] ScreenX/Y, PageX/Y, ClientX/Y的差異
“ ScreenX, PageX, ClientX及ScreenY, PageY, ClientY的差異 ”
分享完整連結 //n.sfs.tw/m10697
分享連結 [JS/Jquery] ScreenX/Y, PageX/Y, ClientX/Y的差異@精讚(文章歡迎轉載,請尊重版權註明連結來源)
2020-12-29 13:09:06 By 張○○
ScreenX, PageX, ClientX及ScreenY, PageY, ClientY的差異
pageX/Y gives the coordinates relative to the <html> element in CSS pixels.
clientX/Y gives the coordinates relative to the viewport in CSS pixels.
screenX/Y gives the coordinates relative to the screen in device pixels.
一目了然的圖片:
FIXED的物件要搭配clientX/clientY使用
ABSOLUTE的物件要搭配pageX/pageY使用
相關連結
https://stackoverflow.com/questions/6073505/what-is-the-difference-between-screenx-y-clientx-y-and-pagex-y
END
你可能有興趣
[Rocky9] 安裝node.js 18, node.js 20
原本的nodejs16在使用 quasar dev時出現錯誤,得升級成18版以上
[SSL] Could not read certificate from server.cer 的錯誤排除
在轉換ssl憑證時,出現無法讀取的錯誤,可是怎麼看憑證都很正常,該怎麼解決?
[Linux] 如何能知道我是什麼時候安裝系統的?
linux想知道什麼時候裝系統的? 不必憑記憶。
地圖填色的網站
我們想為國家填色不需要小畫家,這個網站能幫助你
[Linux] 列出所有目錄及所占空間的方法
想知道目錄下的所有目錄所占的空間大小?
[Linux] grep 排除特定字串
使用 -v 參數可以讓grep排除特定字串的方法