jquery position() not working correctly in safari and chrome

前端 未结 4 916
借酒劲吻你
借酒劲吻你 2021-01-06 03:54

I\'ve seen this question posed once or twice before, but never with an answer that applies to my problem (as far as I know). I have a tooltip that appears when a link is cli

4条回答
  •  离开以前
    2021-01-06 04:46

    position() relates to the position relative to the containing DOM element, as opposed to the position on screen. The difference is probably caused by differences in the way the element hierarchy is rendered in Webkit browsers, rather than by a bug in jQuery.

    You will have to check element hierarchies to find out which DOM element is causing your problem, or, if you want to position your tooltip relative to the position of an element within the window boundaries, use offset() instead.

提交回复
热议问题