473,569 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wierd offsetTop value with relative positioned Element in table inWin IE 6

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 plus minus would still be ok, whyever.

I've tested this successfully on 6.0.2800.1106 on a german W2KPro
machine, also with 6.0.2800.1106 on a german XPPro machine.

When I tested it on 6.0.2600.0000 the output is "209". What?! The
HTML-snipplet below is ripped of from a pretty complex page layout; it's
the bare minimum which reproduces the problem quite well.

My only goal was to find out the exact position of the DIV scroller once
the page is rendered so I can apply some method to emulate a scrolling
mechanism. But this wierd result prevents me from does this. It's
completely useless, I've searched google quite a while but couldn't find
anything.

I hope someone can test this on an english version of XP, maybe with
same version or a higher version and can tell me if the output matches
what I have.

thanks in advance,
- Markus

-------------------8<--------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
body { margin: 0; padding: 0; }
</style>
<script type="text/javascript">
window.onload = function() {
alert(document. getElementById( 'scroller').off setTop);
}
</script>
</head>
<body>
<table>
<tr><td height="100"</td></tr>
<tr>
<td>
<div id="scroller" style="position :relative;">
</div>
</td>
</tr>
</table>
</body>
</html>
Jul 23 '05 #1
3 2860
Markus Fischer wrote:
When I tested it on 6.0.2600.0000 the output is "209". What?! [...]


What I essentially missed here is, that this was tested on an english
version.

sincerly,
- Markus
Jul 23 '05 #2
Markus Fischer wrote:
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 plus minus would still be ok, whyever.

I've tested this successfully on 6.0.2800.1106 on a german W2KPro
machine, also with 6.0.2800.1106 on a german XPPro machine.

When I tested it on 6.0.2600.0000 the output is "209". What?! The
HTML-snipplet below is ripped of from a pretty complex page layout; it's
the bare minimum which reproduces the problem quite well.

My only goal was to find out the exact position of the DIV scroller once
the page is rendered so I can apply some method to emulate a scrolling
mechanism. But this wierd result prevents me from does this. It's
completely useless, I've searched google quite a while but couldn't find
anything.

I hope someone can test this on an english version of XP, maybe with
same version or a higher version and can tell me if the output matches
what I have.

thanks in advance,
- Markus


IE Version 5.50.4522.1800 (English): 209
IE Version 6.0.2800.1106.x psp2.030422-1633 (English): 105
Firefox 0.9.3: 105
Opera 7.54: 107

It appears somewhere between IE 5.5 and 6.0 Service Pack 1 Microsoft changed
something.

Since you know where the discrepancy occurs, you could use conditional
comments to use another method to obtain the information you want in lower
versions (<url:
http://msdn.microsoft.com/workshop/a...omment_ovw.asp
/>):

<script type="text/javascript">
// method used by all DOM2 compliant browsers
</script>
<!--[if lt IE 6.0280]>
<script type="text/javascript">
// method used by IE versions less than 6.0.2800
</script>
<![endif]-->

Note, unfortunately it appears the "version vector" and the "6.0.2600 /
6.0.2800" part are different values, because the above uses the conditional
comment section, even on my 6.0.2800.1106 IE. I'm not sure if 6.0.2600 /
6.0.2800 could be targeted independantly using conditional comments, but
it's worth investigating.

The other possibility is to use conditional comments to target IE entirely,
then use proprietary IE techniques to identify the version you want
specifically:

<![if !IE]>
<script type="text/javascript">
// method used by all browsers except IE
</script>
<![endif]>
<!--[if IE]>
<script type="text/javascript">
// method used by IE
// test clientInformati on.appMinorVers ion
// for the string "SP1" (or something)
</script>
<![endif]-->

--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq

Jul 23 '05 #3
Hi,

thanks for getting a reply. I already though this message would get lost ;)

I well know conditional comments, use them quite often. Its just, it
struck to hunt the problem down, actually only could find a small
testcase but not what the real problem ist. I've to use workaround
currently to get this working.

Many thanks for testing this,

cheers,
- Markus
Jul 23 '05 #4

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

Similar topics

4
10993
by: Ken Kast | last post by:
Here's my situation. I have a statically positioned table that has an image in a cell. I also have some layers, defined by absolute-positioned DIVs for some animation. Everything works until I scroll/resize. Then the image "moves" on the screen but the animation doesn't. The net effect is that their relative positioning changes. I'd like...
16
11470
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not an object... the function is like so: function calc_total() { var x,i,base,margin,total,newmargin,newtotal; base =...
4
8727
by: louissan | last post by:
Hi all, I've met a problem with Opera and its ability to render absolutely positioned divs inside relatively positioned parent blocks, themselves contained inside a relatively positioned block. I'm surely missing something, but what? Any help would be kindly appreciated :) Here's a code sample:
3
19755
by: Markus Ernst | last post by:
Hello Reading the follwing document: http://www.w3.org/TR/WD-positioning-970131#In-flow it seems very clear that position:relative should be relative to the parent element. So in the following test case element1 and element2 should be placed side by side inside a centered white container element: http://www.markusernst.ch/test.htm
2
4292
by: Gernot Frisch | last post by:
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?
1
1547
by: themf | last post by:
Hi, I'm trying to make a page that will become a part of another page, ie. included in the HTML at a particular point. How do I do this so all the stuff inside MY page remains intact, relative to each other, that is, since a lot of the stuff is absolute positioned, if I say that flower.jpg is at (200,300), it shows up at (200,300) in the...
2
3863
by: Martin Geisler | last post by:
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBDNmLx6nfwy35F3TgRAtjIAJ9ryEjr0kaaEapRD0z1bHQYmKi+1wCdEOZC /wY2033SyIVl0za07v8RMkk= =6BZ+ -----END PGP SIGNATURE-----
2
2480
by: Rob R. Ainscough | last post by:
I'm slowly (very slowly) working my way thru the bizarre and sadistic world of control positioning in MultiViews (ASP 2.0). I came across this to help me explain (or attempt to anyway) why my web page controls were all over the place. "Ironically, absolute positioning is relative. Yes, you read that right. An absolutely positioned element...
10
3253
by: Mark | last post by:
According to my book on CSS, if you apply 'position: relative' to a block-level element, it will stay exactly where it is. However, you can then use top, left etc. to offset the element relative to its position. However, looking at other people's stylesheets, I often see 'position: relative' applied to elements but without the use of top,...
0
7694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7921
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.