マウスイベントから絶対的な「上部」位置を取得する(Javascriptを/ jQueryの)
-
20-08-2019 - |
質問
のMouseEnter / mouseleaveイベントで、私はテーブルのセルの絶対的な「上部」位置をキャプチャしたいと思います。
これまでのところ、イベントはそのように装着されます:
$('td[someAttr]').mouseenter(function(mouse) {
// how do we get the td's top absolute position?
//FYI: mouse.pageX and mouse.pageY would give the mouse position
});
解決
$(this).offset().top
所属していません StackOverflow