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.
我想从一个元素中找到左上角的位置。但是,这个元素的父容器有 text-align: center; 因此,如果底行有几个,第一个是 0px,而不是说 450px。
使用offset:
offset
offset = $( yourselectorhere ).offset()