Link to home
Start Free TrialLog in
Avatar of coolispaul
coolispaulFlag for United States of America

asked on

Jquery get X and Y coordfinates of an elemnet within a DIV

Hi

I have a container element of 980px. I want to find the x and y coordinates of an element within that container element.

Im using .position() .
This retrieves the coordinates in relation to the whole viewport. How can i get the coordinates in relation to the container eleemnt?

Thanks
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

I think you want offset http://api.jquery.com/offset/
Avatar of coolispaul

ASKER

hmm i tried that but where do you tell it watch element to offset it against?
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Can you give a bit more info on what the solution was here.
A B grade means the solution given lacked some information or required you to do a good amount of extra work to resolve the problem. When closing the question, the asker should explain why a B grade was awarded.