javascript裏面位置座標解析

總結: 1.包含內邊距和邊框的大小 offsetHeight offsetWidth 2.不包含邊框,但是要考慮子級超過自己時,滾動條的寬度和高度 clientHeight clientWidth 3.子級不超過時和client一樣,超過以子級爲準 scrollHeight scrollWidth 4.與父級的距離,附近要有定位,否則以body爲父級 offsetTop offsetLeft 5.
相關文章
相關標籤/搜索