I have an issue using $.position to retrieve the relative x/y offset on an element. It was mentioned before that both Safari and Chrome differ in handling it as the others.
I'm using Raphael-JS.
To cut the long story short, what I have is an SVG element wrapped by the parent, centered DIV wrapper:
<div>
<svg>
<path/>
</svg>
</div>
In every browser an object returned by $.position which runs on 'path' element gives more or less the correct value. Both Chrome and Safari return negative values for x offset and开发者_开发知识库 0 for y.
Any help will be appreciated, Best regards
Try using Raphael’s cx
and cy
attributes, like in circle.attr("cx")
and circle.attr("cy")
.
精彩评论