![]() Topic awaiting preservation: Way of using Javascript to scroll a div to anchor tag (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Willaimsport, PA, US of A the hole in the Ozone |
![]() Is there any way to use a Javascript function to move a div to a specified anchor tag? |
Paranoid (IV) Inmate From: France |
![]() yep, of course there is. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() Just because I have this sitting here I'll drop them: code: function findPosX(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetLeft obj = obj.offsetParent; } } else if (obj.x) curtop += obj.x; return curtop; } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; }
|
Paranoid (IV) Inmate From: Willaimsport, PA, US of A the hole in the Ozone |
![]() I mean an overflow div. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() Well that's much easier it's just like going to any link. |