在一个的mouseenter /鼠标离开事件,我想捕捉的表格的单元格的绝对“顶部”位置。

到目前为止,该事件被附像这样:

$('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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top