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.
我正在尝试获取 的坐标select option。不是位置,而是 x、y 坐标。我无法通过它JQuery.offset()或position()它只返回我的坐标select。有什么建议吗?
select option
JQuery.offset()
position()
select
谢谢!
正如您所见,您可以这样做:
$('#some-select option[value="3"]').position();
但是,这将与您执行的操作完全相同:
$('#some-select').position();
根本没有办法获得x和y坐标,option因为这在浏览器之间会有很大差异。
x
y
option