Finding div position

Posted on 2006-06-27
Last Modified: 2008-02-01
Hi guys,

I have an div, which is:


and is located inside a table.

I would like to find out the following information:


Now, since those details are not defined in the original stylesheet, javascript returns a NULL value. Any work-arounds for this?

Cheers guys!
Question by:Cyber-Drugs
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 63

Accepted Solution

Zvonko earned 250 total points
ID: 16992226
No gals? ;-)
If you have position:absolute; then is the div positioned absolutely out of table and not relative to cell.
The style attributes are not set, but you can read properties like: div.offsetTop and div.offsetLeft
The property div.offsetBottom is NOT calculated for you. You have to calculate it by looking for div.scrollSize, the body scrollSize and so on.


Assisted Solution

RozanaZ earned 250 total points
ID: 16992231

Author Comment

ID: 16992392

I did wonder how long until someone commented on that, haha! ;-)

That works perfectly, and I'm happy to calculate, as long as I get the numbers to work with, which you have provided me with!


Thanks for the link, I did see it when I did a quick search, but since it's title had "position:relative", I didn't even bother to look at it, but I now see it had what I wanted. Thanks for bringing that to my attention.

Splitting the points evenly on this one, yes Zvonko was first to reply, but RozanaZ pointed out something I should of found before asking my question.

Cheers guys (and gals)
LVL 63

Expert Comment

ID: 16992510
Thanks for splitting points!
See you.
LVL 16

Expert Comment

ID: 16992570
I was just wondering if this library could help you
try the demo and see by yourself

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Provide the IDEA of External JS 1 42
jQuery on click requires double click 6 34
Accordion won't close correctly 5 14
Javascript: Range object 16 17
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question