By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,153 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

top/left

P: n/a
Hi group,

e is an element with 'postion:relative'. Is there a way to retrieve a
numeric value for the top and left property of e. Instead of 'auto'.

Best Regards,

Oliver

--
Leben ist mehr als schneller - weiter - höher
<http://www.nak-nrw.de/p_6_4.html>
Sep 1 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

Well, for mozilla/geckos using DOM as

MYTOP=document.defaultView.getComputedStyle(e,
'').getPropertyValue("top"); and the same for any other property
whose value was computed

For IE is

e.currentStyle.top or e.runtimeStyle.top, fairly sure is the former
for the computed values :)
Danny
Sep 2 '06 #2

P: n/a
Hi Danny,

that returns 'auto' as value of top.

Regards,

Oliver
Danny wrote:
>
Well, for mozilla/geckos using DOM as

MYTOP=document.defaultView.getComputedStyle(e,
'').getPropertyValue("top"); and the same for any other property
whose value was computed

For IE is

e.currentStyle.top or e.runtimeStyle.top, fairly sure is the former
for the computed values :)
Danny
--
Leben ist mehr als schneller - weiter - höher
<http://www.nak-nrw.de/p_6_4.html>
Sep 2 '06 #3

P: n/a
Oliver Block wrote:
e is an element with 'postion:relative'. Is there a way to retrieve a
numeric value for the top and left property of e. Instead of 'auto'.
top and left relative to its parent element? Or relative to the page?

Check out http://www.javascripttoolbox.com/lib/objectposition/ for general
position-finding algorithms.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Sep 2 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.