Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How to determine the relative position of an element?

Reply
Thread Tools

How to determine the relative position of an element?

 
 
delerious@no.spam.com
Guest
Posts: n/a
 
      12-07-2003
I know how to figure out the top coordinate of an element relative to the top
of the document. I can use one of the following:

- document.defaultView.getComputedStyle(document.get ElementById(element_id),
'').getPropertyValue('top')

- document.getElementById(element_id).offsetTop

But I don't know how to determine the top coordinate of an element relative to
the top of the viewable area of the browser. Does anyone know how to do this
(in IE, Opera, and Mozilla)?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
is there a way to determine a relative path to the script? tekion Python 3 01-02-2009 09:16 PM
How to determine TreeView SelectedNode relative position pardesiya ASP .Net Web Controls 1 05-11-2007 06:01 AM
Where is Form Relative Position and Absolute Position in VS.Net 2005 ? Luqman ASP .Net 1 02-07-2006 10:27 AM
How to determine if URL is relative or literal? =?Utf-8?B?QmVuIEZpZGdl?= ASP .Net 2 11-30-2004 01:33 PM



Advertisments