Firefox offsetParent woes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Geoffrey Summerhayes

    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:10 0%;'>
    <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
  • David Mark

    #2
    Re: Firefox offsetParent woes

    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:bl ock" 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:10 0%;'>
                 <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.

    Comment

    • Geoffrey Summerhayes

      #3
      Re: Firefox offsetParent woes

      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:bl ock" 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

      Comment

      Working...