473,409 Members | 2,022 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,409 software developers and data experts.

IE Pixel discrepancy with top / scrollTop

In the following (IE only) mini page (a table which is supposed
to have a fixed header), when you first do anything with the scroll
bar, you will see the top two rows of the table jump slightly
(a few pixels) down and to the right. I could figure out
a specific numeric fudge factor value that will make me happy
on my own Win 2K / IE 6 system, but I'd like to know a proper
way to make this more general (for other IEs).

Thanks,
Csaba Gabor
<BODY>
<DIV style='width:4in;border:pink 1 solid'>
Notice that the first time you use the scroll bar, the
header position (top two rows) jumps a few pixels
down and to the right. How do I properly correct that?
</DIV><BR>

<DIV style='height:1.5in;border:green 1 solid;overflow:auto'>
<TABLE border=1 id=lowerTable border=0
style='border:blue 1 solid;background-color:yellow'>

<THEAD style='color:white;background-color:purple'>
<TR style='position:relative'
style='top:expression(this.offsetParent.scrollTop) '>
<TH colspan=3>Sample table</TH></TR>
<TR style='position:relative'
style='top:expression(this.offsetParent.scrollTop) '>
<TH>This</TH><TH>is the</TH>
<TH>header row</TH></TR></THEAD>

<TR><TD>Row One</TD><TD>0</TD><TD>1</TD></TR>
<TR><TD>2</TD><TD>Row Two</TD><TD>3</TD></TR>
<TR><TD>4</TD><TD>5</TD><TD>Row Three</TD></TR>
<TR><TD>6</TD><TD>7</TD><TD>Row Four</TD></TR>
<TR><TD>8</TD><TD>Row Five</TD><TD>9</TD></TR>
<TR><TD>Row Six</TD><TD>10</TD><TD>11</TD></TR>
<TR><TD>Row Seven</TD><TD>12</TD><TD>13</TD></TR>
<TR><TD>14</TD><TD>Row Eight</TD><TD>15</TD></TR>
<TR><TD>16</TD><TD>17</TD><TD>Row Nine</TD></TR>
</TABLE>
</BODY>
Jul 23 '05 #1
1 1712
Ivo
"Csaba Gabor" <ne**@CsabaGabor.com> wrote in message
news:40******@andromeda.datanet.hu...
In the following (IE only) mini page (a table which is supposed
to have a fixed header), when you first do anything with the scroll
bar, you will see the top two rows of the table jump slightly
(a few pixels) down and to the right. I could figure out
a specific numeric fudge factor value that will make me happy
on my own Win 2K / IE 6 system, but I'd like to know a proper
way to make this more general (for other IEs).

Thanks,
Csaba Gabor
<snip code>
<TR style='position:relative'
style='top:expression(this.offsetParent.scrollTop) '>


Changing this line to

<tr style='top:expression(this.scrollTop)'>

works fine in my WinMe/IE6 browser.
Even better, setting the style of the THEAD element allows me to remove
these definitions from all TR's inside it.

HTH
Ivo
Jul 23 '05 #2

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

Similar topics

2
by: London Boy | last post by:
Hi, i've done a script that makes a DIV appear and follow the mouse cursor and it works fine but, it has a small glitch, when i scroll the document, the DIV doesn't appear beside the cursor but...
1
by: Csaba Gabor | last post by:
In the following (IE only) mini page (a table which is supposed to have a fixed header), when you first do anything with the scroll bar, you will see the top two rows of the table jump slightly (a...
2
by: Axel Schick | last post by:
Hello everybody! I encountered a strange behavior when trying to read the scrollTop propery of the <body> element from inside an iFrame: <body onmousemove = "window.status =...
0
by: Kevin R. | last post by:
Hi All, I have the following control hierarchy dynamically generated on the server: A number of hierarical checkbox controls are added to a Placeholder control. Placeholder control then added...
0
by: gregtyndall | last post by:
I have a weird problem. I'm using a master page to hold a menu that I want to scroll as the user scrolls in the browser window so it will always be visible. First off, putting onsroll in the body...
9
by: Andy | last post by:
Hey all, I'm building out my first project using asp.net v2.0 master pages. It seems that when you use master pages and try to reference document.body.scrollTop it allways = zero/0. The same code...
30
by: Chaos | last post by:
As my first attempt to loop through every pixel of an image, I used for thisY in range(0, thisHeight): for thisX in range(0, thisWidth): #Actions here for Pixel thisX, thisY But it takes...
0
by: bluegrasslover | last post by:
I've gotten a couple of emails about this problem lately so I'm going to post the solution that someone emailed me a while back. When you create a master page visual studio automatically adds a...
2
by: =?Utf-8?B?SGFyZHkgV2FuZw==?= | last post by:
Hi all, I created a complex ASPX page, nested inside a master page and Ajax UpdatePanel. In one of my Javascript function I need to capture mouse position. I use alert(document.body.scrollTop) to...
1
by: ofiras | last post by:
In bitmap, how can I find the nearest pixel (pixel 1) to a specific pixel (pixel 2) that has different color from pixel 2? Or how can I find a pixel in a specific distance from pixel 2 (like a...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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.