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.

Taidot: Javascript

Näytä lisää: 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

Tietoa työnantajasta:
( 9 arvostelua ) Brooklyn, United States

Projektin tunnus: #200384

Myönnetty käyttäjälle:


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 Lisää

$100 USD 1 päivässä
(1 arvostelu)

6 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön


Hello, please check your PMB

$30 USD 0 päivässä
(20 arvostelua)

hi check your PMB. regards adnan

$100 USD 2 päivässä
(6 arvostelua)

Please see my PM. Regards.

$80 USD 1 päivässä
(2 arvostelua)

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

$30 USD 5 päivässä
(0 arvostelua)

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

$100 USD 1 päivässä
(0 arvostelua)