Absolutely position a div inside a relative position element

The task is to modify an existing javascript include file. More details, including the sample HTML that includes it is in attached zip archvive.


The DIV needs to be positioned absolutely and to do this a correct position of text ad box needs to be obtained from browser. This position is obtained by traversing offsetParent object all the way to the root and getting totals

offsetLeft and offsetTop

function getAbsolutePosition(element) {

var r = { x: [url removed, login to view], y: [url removed, login to view] };

if ([url removed, login to view]) {

var tmp = getAbsolutePosition([url removed, login to view]);

r.x += tmp.x;

r.y += tmp.y;


return r;


However, this does not work reliably for structures that have some of the elements POSITION:RELATIVE – hence the attached sample. Please run [url removed, login to view] in IE6, under 1280x1024 or similar resolution. You can see that the HTML page uses a CSS file which contains two elements positioned relatively:

#container {

POSITION: relative; …


#wrapper {

POSITION: relative; …


Removing these statements fixes the problem, but we cannot do that since we are just an include file in this file and don’t own the actual HTML.

For expert level javascript developer we estimate the task to be only a few hours long. Please provide a fixed bid cost and state wether the cost is for Part A or for Part B or both. For both parts we will definately pay more than $100. Please take a few minutes to read the attached document.

Skills: Javascript

See more: position div inside div, javascript position element, javascript position div, javascript div position, javascript position relative, div inside div position, div position inside div, position relative inside div, positioning div inside div, div relative element, javascript position inside div, position div relative element, javascript div position relative, div position javascript, position div javascript, javascript getting position within relative div, div relative position, position inside div, div position inside, javascript position within div, div position relative click, div inside div relative, javascript relative position, element position div, absolutely position

About the Employer:
( 9 reviews ) Brooklyn, United States

Project ID: #200384

Awarded to:


Dear Sir. I'm pleased to bid on your project. Our team is expert in javascript coding. Now your needs are clear. I'm sure we can complete this one for 1 or 2 days. We are thankful if you pay about $150 for both pa More

$100 USD in 1 day
(1 Review)

6 freelancers are bidding on average $73 for this job


Hello, please check your PMB

$30 USD in 0 days
(20 Reviews)

hi check your PMB. regards adnan

$100 USD in 2 days
(6 Reviews)

Please see my PM. Regards.

$80 USD in 1 day
(2 Reviews)

Ok I see your [url removed, login to view] give me this job to me i can complete this site. i need 150$ for total working. Best Regards.

$30 USD in 5 days
(0 Reviews)

I am front end Engineer and doing this type of stuff.

$100 USD in 1 day
(0 Reviews)