1

On a mouseenter/mouseleave event, I would like to capture the absolute 'top' position of the cell of a table.

So far, the event is attached like so:

$('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
});

1 Answer 1

4
$(this).offset().top
Sign up to request clarification or add additional context in comments.

2 Comments

This will not give that absolute top; it'll give the position relative to its parent element; see docs.jquery.com/CSS/position
yeah i changed to offset before your comment & answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.