473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

TD .offsetTop not working in IE6

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:
to******************************@invalid.com
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
Jul 23 '05 #1
2 4288
Gernot Frisch wrote:
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.
Jul 23 '05 #2

"Yann-Erwan Perio" <y-*******@em-lyon.com> schrieb im Newsbeitrag
news:40***********************@news.free.fr...
Gernot Frisch wrote:
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?


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
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Markus Fischer | last post by:
Hi, I'm experiencing a wierd problem with IE 6 in Windows with two _slightly_ different Version. Give the following HTMl-Code, ideally the output of offsetTop should be "105"; a few pixel...
4
by: Pf | last post by:
A piece of html code: <table> <tr> <td> <input type="text" name="myInput" onclick="myFunction(this)"> <td> </tr> </table>
6
by: Francisco | last post by:
Hi all, I have a div (divI) inner another div (divM), when i request the offsetTop of divI (inner) it returns me the top of divI in divM and not the top of divI in the document? Have anyway to...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
1
by: Tarik Monem | last post by:
OK, you guys have helped me when I couldn't help myself, well I could but I couldn't if you know what I mean. So, here's another that I'm having issues with for just Safari -- tested in Firefox &...
2
by: rohitchawla | last post by:
have a problem with this code when working in IE it gives me 0,0 coords when i use iframe tag but gives correct coords when using firefox function GetRealOffset(id) { var elem =...
1
by: tromton | last post by:
Hello all, I have a problem with a scrript in safari 3. in mozilla/firefox and opera the problem does not exist. what i try to do: I have a div element with overflow:auto. in the element i have...
3
pragathik
by: pragathik | last post by:
hi, i have a problem with document.body.offsetTop and document.body.offsetLeft always returns null in my code in IE6. how can I get the values???? please suggest
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.