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

Firefox offsetParent woes

I'm trying to select a row from a table in a 'dialog box' where the
HTML is (boiled down):

<body>
<div style='position:absolute; display:block;...'>
...other divs...
<div style='position:absolute...'>
...other divs...
<div style='display:block; overflow:auto; margin-left:auto;
margin-right:auto; width:...'>
<table style='width:100%;'>
<tr></tr>
<tr></tr>
</table>
</div>
...other divs...
</div>
</div>
</body>

Working upward through the chain of offsetParents to get
offsetTop and scrollTop works fine in IE. But FF skips the
overflow:auto div, it doesn't appear in the chain.

So, how do I get this to work correctly with IE and FF?

----
Geoff
Feb 12 '08 #1
2 2222
On Feb 12, 12:58*pm, Geoffrey Summerhayes <sumr...@gmail.comwrote:
I'm trying to select a row from a table in a 'dialog box' where the
HTML is (boiled down):

<body>
* <div style='position:absolute; display:block;...'>
The "display:block" rule is redundant here.
* * ...other divs...
* * <div style='position:absolute...'>
* * * * ...other divs...
* * * * <div style='display:block; overflow:auto; margin-left:auto;
margin-right:auto; width:...'>
* * * * * *<table style='width:100%;'>
* * * * * * *<tr></tr>
* * * * * * *<tr></tr>
* * * * * *</table>
* * * * </div>
* * * * ...other divs...
* * </div>
* </div>
</body>

Working upward through the chain of offsetParents to get
offsetTop and scrollTop works fine in IE. But FF skips the
overflow:auto div, it doesn't appear in the chain.
That is because IE and FF implement offsetParent differently.
>
So, how do I get this to work correctly with IE and FF?
Are you trying to create a generalized solution? If so, see the
parentNode property. If not, just adjust for the scrollTop/Left
properties of the known scrolling container.

Feb 12 '08 #2
On Feb 12, 2:17*pm, David Mark <dmark.cins...@gmail.comwrote:
On Feb 12, 12:58*pm, Geoffrey Summerhayes <sumr...@gmail.comwrote:
I'm trying to select a row from a table in a 'dialog box' where the
HTML is (boiled down):
<body>
* <div style='position:absolute; display:block;...'>

The "display:block" rule is redundant here.
No big. It's coming from a combination of
stylesheet rules.
>
So, how do I get this to work correctly with IE and FF?

Are you trying to create a generalized solution? *If so, see the
parentNode property. *If not, just adjust for the scrollTop/Left
properties of the known scrolling container.
parentNode it is then, I'm trying to get as many
generalized sol'ns as possible to sit in one file
and cut down on the amount of specific javascript
that is required.

---
Thanks,
Geoff
Feb 12 '08 #3

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

Similar topics

4
by: Keith Thornhill | last post by:
I'm trying to calculate the top and left distance from the side of the browser of an object (either absolutely or relatively positioned) and i'm running into a weird problem as i'm trying to make...
2
by: Mark Szlazak | last post by:
The following code fails in Firefox to get at selected text in the right-side textarea. Any help would be appreciated. <html> <head> <script> var agt = navigator.userAgent.toLowerCase();...
1
by: Mickey | last post by:
Hi, I have a script which works in both IE but is sluggish in Firefox. The script is a simple text scroller. It works perfectly in IE however in Firefox, the text scroll slower and eventually...
2
by: amattie | last post by:
Anyone know what the specific difference is between the offsetParent and parentNode properties of a DOM element are? Mozilla's docs on the DOM element...
1
by: chris1606 | last post by:
This script floats one image over another (to conterract transparency). It works fine in Opera and Internet Explorer, but the image won't move in firefox. Any ideas how I can get it to work please? ...
5
by: webEater | last post by:
In XHTML mode (application/xhtml+xml) Firefox does not know offset properties (offsetParent/Left/Top). In all the other browsers it works. Does someone has the same problem or knows a solution for...
1
by: inteli | last post by:
Hey anybody can help me out wid this code..Its working well in IE but nt in firefox.The problem lies in offset,clientX,clientY part but I dnt know how to resolve it .. var zxcDockAry=new Array();...
3
by: geetha v | last post by:
Hi All, I need a scrolling DIV is a to display my dynamic tree in left frame. In my jsp , Div overflow is set to "auto" <DIV id=divScroller style="overflow:auto;height:200px"> <!--...
10
by: Humakt | last post by:
Hey all. It's been a while since I last visited. Short description of program: Board game which's html elements are fully constructed using DHTML/Javascript. Board is constructed of html table,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.