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 |
posted 06-10-2005 18:46
Is there any way to use a Javascript function to move a div to a specified anchor tag? |
Paranoid (IV) Inmate From: France |
posted 06-10-2005 19:00
yep, of course there is. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 06-10-2005 19:35
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 |
posted 06-10-2005 23:39
I mean an overflow div. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 06-11-2005 00:11
Well that's much easier it's just like going to any link. |