문제

I'm having some issues getting the offset of a object which is contained in a fixed parent. I understand that using object.offset() will give the position relative to the whole document, but when I put that object in a fixed container, it then returns the offset relative to the screen you're on.

I'm trying to display another object at a position relative to the first - so if you're at the very top of a page, it'll look fine, but if you've scrolled down then it won't. I've found this when using a JQuery Dialog, but have been able to replicate it on regular objects as well.

Is this expected behavior? If so, is there a way to find the position of an object relative to the document even when contained in a fixed parent?

도움이 되었습니까?

해결책

Huh, so I did some follow up here - I wasn't able to replicate it in JSFiddle. Whatever the problem is seems to be specific to my own environment. Guess I'll just keep bashing and see if I can find what's specifically causing this issue.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top