How to calculate X and Y of a div?
Hi,
I want to calculate X and Y of a div, but I get an infinite loop, can you tell me please what's the problem with my code?
- Left = Obj.offset().left;
- while(Obj.offsetParent()!=null)
- {
- ObjParent = Obj.offsetParent();
- Left += ObjParent.offset().left;
- Obj = ObjParent;
- }
What do you think?