How to get element's absolute postion in px? jQuery

55 Views Asked by At

I made a visualisation ;) https://www.dropbox.com/s/sj7mbi6vjx0ebx6/visual.png?dl=0 I want to get offset of element from HTML or body. (that red line :D) $('#awp').offset().left gives me 8, $('#awp').position().left gives 8 as well. I know that the offset from body tag is 500+.

SOLVED!!!! My css was: img{display:inline;}, should be img,div{display:inline;} Mistakes like that are really annoying.

0

There are 0 best solutions below