TD .offsetTop not working in IE6

G

Gernot Frisch

Hi,
when I have this code in my script:
pos_y = document.getElementById('holdmenu').offsetTop;

The menu get's positioned at the very top of the site - really
annoying. On FireFox it works good. If I put this script part at the
very end of the body, it works, too.

Can you help me what's wrong here?



--
-Gernot

Post here, don't email. If you feel you have to mail, revert my
forename from:
(e-mail address removed)
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
 
Y

Yann-Erwan Perio

Gernot said:
when I have this code in my script:
pos_y = document.getElementById('holdmenu').offsetTop;

The menu get's positioned at the very top of the site - really
annoying. On FireFox it works good. If I put this script part at the
very end of the body, it works, too.

"offsetTop" is calculated in regards of the offsetParent, a container
element. Your problem may be related to your setting styles for one of
this container element after reading the offsetTop value (check any
absolute-positioned elements). In that case, browsers' implementation
could take the change into account quite differently.

Could you post some lines demonstrating the issue?


Regards,
Yep.
 
G

Gernot Frisch

Yann-Erwan Perio said:
"offsetTop" is calculated in regards of the offsetParent, a container
element. Your problem may be related to your setting styles for one of
this container element after reading the offsetTop value (check any
absolute-positioned elements). In that case, browsers' implementation
could take the change into account quite differently.

Could you post some lines demonstrating the issue?

I use a slightly changed version of this:
http://www.bmchebbi.addr.com/advancedmenunotes.htm

Can you help? Also, Can you tell me hot to "move" the menu (e.g. after
a window.onresize)? I think I have to modify the DIVs positions, but I
don't know how to loop through all of them. That's a bit my problem.
I'm a C++ coder and JavaScript is so... well... "ambigious". Things
like:
var couldbeanyting [];
anyvar['Somewhere']...

and then 'Anystring'.SomeOtherFunction and 'this.' is really strange
to me...

-Gernot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top