Position (). upper inconsistencies when (zoom <1)

I use a fixed position window with horizontal and vertical scrolling. And using position.top () to find the specific position of the div.

  var position = anchor.position().top; 

But when the scale is 1 or> 1, it works completely fine. But when the scaling is <1, then there are inconsistencies.

Jsfiddle example

+5
source share
1 answer

You must subtract the position of the inner contents.

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

Checkout jsfiddle

+3
source

All Articles