Reputation: 193
I am trying to get offset position of an object which is not on screen. For example, I have a scroll which display two html pages, I want to draw lines on second page which is not on the curent screen. When i try to get offset it return me NaN.
Anyone have any idea how to get the positions of object which is not on screen?
Upvotes: 0
Views: 472
Reputation: 92324
I don't know of any problems getting the position of an off-screen object. You just need to make sure it is rendered. Usually, the problem is that your element is set to display:none, in which case you get NaN for its position. There are two solutions:
Please post simplified code to show your problem if this does not solve your problem.
Upvotes: 1