Bhawna Bhawna - 2 months ago 7
jQuery Question

position().top inconsistencies when (zoom < 1)

I am using a window of fixed position with horizontal and vertical scroll. And using position.top() to find the particular position of the div.

var position = anchor.position().top;


But when zoom is 1 or >1 then it is working totally fine.
But when zoom is <1 then there are inconsistencies.

Example Jsfiddle

Answer

You have to subtract the position of inner content

var position = anchor.position().top - $('.innercontent').position().top;

Checkout this jsfiddle

Comments