Why offsetTop returns different value in Chrome an

2019-08-18 05:39发布

问题:

We are working on angular application in which we need to show one element on top of the page after browser's scroll reach to that element.

Is there any CSS issue which is impacted.

Below is the code.

elementRef.nativeElement.offsetParent.offsetTop;