No offsetParent in Firefox?

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

    No offsetParent in Firefox?

    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 this?
    Example:

    ....
    <body>

    <div><div id="hello">Hey </div></div>

    <div id="debug"></div>

    <script type="text/javascript">
    //<![CDATA[
    alert(document. getElementById( 'hello').offset Parent);
    //]]>
    </script>

    </body>
    ....

    In Firefox offsetLeft and offsetTop is 0, the script above shows null
    as result. Can somebody help me?

    Andi

  • Jeremy

    #2
    Re: No offsetParent in Firefox?

    webEater wrote:
    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 this?
    Example:
    >
    ...
    <body>
    >
    <div><div id="hello">Hey </div></div>
    >
    <div id="debug"></div>
    >
    <script type="text/javascript">
    //<![CDATA[
    alert(document. getElementById( 'hello').offset Parent);
    //]]>
    </script>
    >
    </body>
    ...
    >
    In Firefox offsetLeft and offsetTop is 0, the script above shows null
    as result. Can somebody help me?
    >
    Andi
    >
    XHTML MIME types are not ready for prime time in a lot of respects :-P
    For example, there is no such thing as incremental loading of an XHTML
    document served with the proper MIME type.

    If you're keen on using application/xhtml+xml anyway, you might ask in
    mozilla.dev.tec h.javascript on news.mozilla.or g - they will be far
    better equipped to handle mozilla-specific javascript questions.

    Also try mozilla.dev.tec h.dom.

    Jeremy

    Comment

    • webEater

      #3
      Re: No offsetParent in Firefox?



      On 19 Dez., 02:36, Jeremy <jer...@pinacol .comwrote:
      webEater wrote:
      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 this?
      Example:
      >
      ...
      <body>
      >
      <div><div id="hello">Hey </div></div>
      >
      <div id="debug"></div>
      >
      <script type="text/javascript">
      //<![CDATA[
      alert(document. getElementById( 'hello').offset Parent);
      //]]>
      </script>
      >
      </body>
      ...
      >
      In Firefox offsetLeft and offsetTop is 0, the script above shows null
      as result. Can somebody help me?
      >
      AndiXHTML MIME types are not ready for prime time in a lot of respects :-P
      For example, there is no such thing as incremental loading of an XHTML
      document served with the proper MIME type.
      >
      If you're keen on using application/xhtml+xml anyway, you might ask in
      mozilla.dev.tec h.javascript on news.mozilla.or g - they will be far
      better equipped to handle mozilla-specific javascript questions.
      >
      Also try mozilla.dev.tec h.dom.
      >
      Jeremy
      Thank you, I have posted on mozilla.dev.tec h.dom. Although - is there
      an other way to find out the real position of an element to a parent
      one?

      Andi

      Comment

      • Martin Honnen

        #4
        Re: No offsetParent in Firefox?

        webEater wrote:
        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 this?
        Example:
        >
        ...
        <body>
        >
        <div><div id="hello">Hey </div></div>
        >
        <div id="debug"></div>
        >
        <script type="text/javascript">
        //<![CDATA[
        alert(document. getElementById( 'hello').offset Parent);
        //]]>
        </script>
        I am sure it is available if you wait for the page to be loaded. Mozilla
        so far for XML parsing and rendering has no incremental approach that
        would allow script called _during page load_ to get such values correctly.


        --

        Martin Honnen

        Comment

        • mick white

          #5
          Re: No offsetParent in Firefox?

          webEater wrote:
          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 this?
          Example:
          >
          ...
          <body>
          >
          <div><div id="hello">Hey </div></div>
          >
          <div id="debug"></div>
          >
          <script type="text/javascript">
          //<![CDATA[
          alert(document. getElementById( 'hello').offset Parent);
          //]]>
          </script>
          >
          </body>
          <script type="text/javascript">
          //<![CDATA[
          onload=function (){ alert(document. getElementById( 'hello').offset Parent);}
          //]]>
          </script>

          How does that work for you?
          Mick
          ...
          >
          In Firefox offsetLeft and offsetTop is 0, the script above shows null
          as result. Can somebody help me?
          >
          Andi
          >

          Comment

          • webEater

            #6
            Re: No offsetParent in Firefox?


            mick white schrieb:
            webEater wrote:
            >
            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 this?
            Example:

            ...
            <body>

            <div><div id="hello">Hey </div></div>

            <div id="debug"></div>

            <script type="text/javascript">
            //<![CDATA[
            alert(document. getElementById( 'hello').offset Parent);
            //]]>
            </script>

            </body>
            >
            <script type="text/javascript">
            //<![CDATA[
            onload=function (){ alert(document. getElementById( 'hello').offset Parent);}
            //]]>
            </script>
            >
            How does that work for you?
            Mick
            ...

            In Firefox offsetLeft and offsetTop is 0, the script above shows null
            as result. Can somebody help me?

            Andi
            I haven't tried it out but i am sure itr works. In the mozilla dev
            group they said that the Gecko engine does not builds up the dom (or
            whatevery) completely until the complete page ha been loaded. After
            complete loading offsetParent etc are computed, so I have to take
            onload or domload..

            Comment

            Working...