在 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
关于javascript - 从鼠标事件获取绝对位置 'top' (Javascript/jQuery),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1045398/