Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法获取元素的当前位置?它是 x 和 y。我试过了getLocationOnScreen,getLocationInWindow但结果是不确定的。
getLocationOnScreen
getLocationInWindow
我认为getLocationOnScreenandgetLocationInWindow应该是对象,getLocationOnScreen().x 否则.y 会好的。
getLocationOnScreen().x
.y