Loading ...
Sorry, an error occurred while loading the content.

YAHOO.util.Dom.getStyle 'height' property NaN for IE 6.0

Expand Messages
  • functionform
    I m sure it s me. I have an Event.onAvailable running a method to query the height of a div. the div is the only item in the body tag and it contains some
    Message 1 of 8 , Aug 1, 2006
    • 0 Attachment
      I'm sure it's me. I have an Event.onAvailable running a method to
      query the height of a div. the div is the only item in the body tag
      and it contains some lorem ipsum text. it's height and width are not
      set explicitly.

      when I do:
      YAHOO.util.Dom.getStyle('divname','height')
      (and parseInt it)

      I get a number for Firefox, but when I do it for IE, it gives me NaN.
      (yes I know it's "not a number" ;) ). Does IE require some container
      div or an explicit height or something else I've missed?

      It'd be ideal if the height could be picked up dynamically.

      TIA!
    • Matt Sweeney
      When no height is set for IE, getStyle returns auto . This is due to differences between currentStyle (what IE is using) and computedStyle (used by other
      Message 2 of 8 , Aug 2, 2006
      • 0 Attachment
        When no height is set for IE, getStyle returns "auto". This is due to
        differences between currentStyle (what IE is using) and computedStyle
        (used by other browsers).

        You can always get the actual height of an element via offsetHeight,
        provided it is rendered in the document (i.e. not set to
        "display:none"), but keep in mind that this includes borders and
        padding, which may or may not be the desired effect.

        Matt

        functionform wrote:

        >I'm sure it's me. I have an Event.onAvailable running a method to
        >query the height of a div. the div is the only item in the body tag
        >and it contains some lorem ipsum text. it's height and width are not
        >set explicitly.
        >
        >when I do:
        >YAHOO.util.Dom.getStyle('divname','height')
        >(and parseInt it)
        >
        >I get a number for Firefox, but when I do it for IE, it gives me NaN.
        >(yes I know it's "not a number" ;) ). Does IE require some container
        >div or an explicit height or something else I've missed?
        >
        >It'd be ideal if the height could be picked up dynamically.
        >
        >TIA!
        >
        >
        >
        >
        >
        >
        >
        >Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
      • Adam Leckron
        yeah, but isn t the point of using the DOM utils is so that you don t need to worry about browser differences? The Dom Collection comprises a family of
        Message 3 of 8 , Sep 10, 2007
        • 0 Attachment
          yeah, but isn't the point of using the DOM utils is so that you don't need to worry about browser differences?
          "The Dom Collection comprises a family of convenience methods that simplify common DOM-scripting tasks, including element positioning and CSS style management, while normalizing for cross-browser inconsistencies"

          --- In ydn-javascript@yahoogroups.com, Matt Sweeney <msweeney@...> wrote:
          >
          > When no height is set for IE, getStyle returns "auto". This is due to
          > differences between currentStyle (what IE is using) and computedStyle
          > (used by other browsers).
          >
          > You can always get the actual height of an element via offsetHeight,
          > provided it is rendered in the document (i.e. not set to
          > "display:none"), but keep in mind that this includes borders and
          > padding, which may or may not be the desired effect.
          >
          > Matt
          >
          > functionform wrote:
          >
          > >I'm sure it's me. I have an Event.onAvailable running a method to
          > >query the height of a div. the div is the only item in the body tag
          > >and it contains some lorem ipsum text. it's height and width are not
          > >set explicitly.
          > >
          > >when I do:
          > >YAHOO.util.Dom.getStyle('divname','height')
          > >(and parseInt it)
          > >
          > >I get a number for Firefox, but when I do it for IE, it gives me NaN.
          > >(yes I know it's "not a number" ;) ). Does IE require some container
          > >div or an explicit height or something else I've missed?
          > >
          > >It'd be ideal if the height could be picked up dynamically.
          > >
          > >TIA!
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > >Yahoo! Groups Links
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          >
        • Philippe AMELINE
          In the same trend, if I define a DIV as an Overlay, with its height defined as 50px in the CSS, I get the following behavior (Firefox and IE): servicesBlock =
          Message 4 of 8 , Sep 10, 2007
          • 0 Attachment
            In the same trend, if I define a DIV as an Overlay, with its height
            defined as 50px in the CSS, I get the following behavior (Firefox and IE):

            servicesBlock = new YAHOO.widget.Overlay("controlBlock", { visible:true,
            constraintoviewport:false } );
            servicesBlock.render();

            var domHeight = YAHOO.util.Dom.getStyle('controlBlock','height'); ->
            50px
            var offsetHeight = $("controlBlock").offsetHeight
            ; -> 50
            var svcsHeight =
            servicesBlock.height ->
            undefined

            Why do you think that servicesBlock.height returns "undefined"?

            Philippe

            Adam Leckron wrote:
            > yeah, but isn't the point of using the DOM utils is so that you don't
            > need to worry about browser differences?
            >
            > "The Dom Collection comprises a family of convenience methods that
            > simplify common DOM-scripting tasks, including element positioning
            > and CSS style management, while normalizing for cross-browser
            > inconsistencies"
            >
            >
            > --- In ydn-javascript@yahoogroups.com, Matt Sweeney <msweeney@...> wrote:
            > >
            > > When no height is set for IE, getStyle returns "auto". This is due to
            > > differences between currentStyle (what IE is using) and computedStyle
            > > (used by other browsers).
            > >
            > > You can always get the actual height of an element via offsetHeight,
            > > provided it is rendered in the document (i.e. not set to
            > > "display:none"), but keep in mind that this includes borders and
            > > padding, which may or may not be the desired effect.
            > >
            > > Matt
            > >
            > > functionform wrote:
            > >
            > > >I'm sure it's me. I have an Event.onAvailable running a method to
            > > >query the height of a div. the div is the only item in the body tag
            > > >and it contains some lorem ipsum text. it's height and width are not
            > > >set explicitly.
            > > >
            > > >when I do:
            > > >YAHOO.util.Dom.getStyle('divname','height')
            > > >(and parseInt it)
            > > >
            > > >I get a number for Firefox, but when I do it for IE, it gives me NaN.
            > > >(yes I know it's "not a number" ;) ). Does IE require some container
            > > >div or an explicit height or something else I've missed?
            > > >
            > > >It'd be ideal if the height could be picked up dynamically.
            > > >
            > > >TIA!
            > > >
            > > >
            > > >
            > > >
            > > >
            > > >
            > > >
            > > >Yahoo! Groups Links
            > > >
            > > >
            > > >
            > > >
            > > >
            > > >
            > > >
            > > >
            > > >
            > > >
            > >
            >
          • dav.glass@yahoo.com
            Because servicesBlock is a reference to the Overlay object not the DOM object.. Try this: YAHOO.util.Dom.getStyle(servicesBlock.element, height ); Hope that
            Message 5 of 8 , Sep 10, 2007
            • 0 Attachment
              Because servicesBlock is a reference to the Overlay object not the DOM object..

              Try this:

              YAHOO.util.Dom.getStyle(servicesBlock.element, 'height');
               
              Hope that helps :)
              Dav

              Dav Glass
              dav.glass@...
              blog.davglass.com
               
               
              + Windows: n. - The most successful computer virus, ever. +
              + A computer without a Microsoft operating system is like a dog
              without bricks tied to its head +
              + A Microsoft Certified Systems Engineer is to computing what a
              McDonalds Certified Food Specialist is to fine cuisine +


              ----- Original Message ----
              From: Philippe AMELINE <philippe.ameline@...>
              To: ydn-javascript@yahoogroups.com
              Sent: Monday, September 10, 2007 7:50:04 AM
              Subject: Re: [ydn-javascript] Re: YAHOO.util.Dom.getStyle 'height' property NaN for IE 6.0

              In the same trend, if I define a DIV as an Overlay, with its height
              defined as 50px in the CSS, I get the following behavior (Firefox and IE):

              servicesBlock = new YAHOO.widget. Overlay(" controlBlock" , { visible:true,
              constraintoviewport :false } );
              servicesBlock. render();

              var domHeight = YAHOO.util.Dom. getStyle( 'controlBlock' ,'height' ); ->
              50px
              var offsetHeight = $("controlBlock" ).offsetHeight
              ; -> 50
              var svcsHeight =
              servicesBlock. height ->
              undefined

              Why do you think that servicesBlock. height returns "undefined"?

              Philippe

              Adam Leckron wrote:

              > yeah, but isn't the point of using the DOM utils is so that you don't
              > need to worry about browser differences?
              >
              > "The Dom Collection comprises a family of convenience methods that
              > simplify common DOM-scripting tasks, including element positioning
              > and CSS style management, while normalizing for cross-browser
              > inconsistencies"
              >
              >
              > --- In ydn-javascript@ yahoogroups. com, Matt Sweeney <msweeney@.. .> wrote:
              > >
              > > When no height is set for IE, getStyle returns "auto". This is due to
              > > differences between currentStyle (what IE is using) and computedStyle
              > > (used by other browsers).
              > >
              > > You can always get the actual height of an element via offsetHeight,
              > > provided it is rendered in the document (i.e. not set to
              > > "display:none" ), but keep in mind that this includes borders and
              > > padding, which may or may not be the desired effect.
              > >
              > > Matt
              > >
              > > functionform wrote:
              > >
              > > >I'm sure it's me. I have an Event.onAvailable running a method to
              > > >query the height of a div. the div is the only item in the body tag
              > > >and it contains some lorem ipsum text. it's height and width are not
              > > >set explicitly.
              > > >
              > > >when I do:
              > > >YAHOO.util. Dom.getStyle( 'divname' ,'height' )
              > > >(and parseInt it)
              > > >
              > > >I get a number for Firefox, but when I do it for IE, it gives me NaN.
              > > >(yes I know it's "not a number" ;) ). Does IE require some container
              > > >div or an explicit height or something else I've missed?
              > > >
              > > >It'd be ideal if the height could be picked up dynamically.
              > > >
              > > >TIA!
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >Yahoo! Groups Links
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > >
              >


            • Philippe AMELINE
              It helps, thanks! But shouldn t the Overlay object have a valid height property when height has been set in the CSS? This height property is defined as
              Message 6 of 8 , Sep 10, 2007
              • 0 Attachment
                It helps, thanks!

                But shouldn't the Overlay object have a valid "height" property when
                height has been set in the CSS?
                This "height" property is defined as "CSS height of the Overlay"
                (http://developer.yahoo.com/yui/docs/YAHOO.widget.Overlay.html) but it
                seems that it contains the property that is set at construction time.

                In my previous example, if I do :
                servicesBlock = new YAHOO.widget.Overlay("controlBlock", { visible:true,
                constraintoviewport:false, height:"50px" } )

                Then servicesBlock.height returns 50

                Philippe

                dav.glass@... wrote:
                > Because servicesBlock is a reference to the Overlay object not the DOM
                > object..
                >
                > Try this:
                >
                > YAHOO.util.Dom.getStyle(servicesBlock.element, 'height');
                >
                > Hope that helps :)
                > Dav
                >
                > Dav Glass
                > dav.glass@...
                > blog.davglass.com
                >
                >
                > + Windows: n. - The most successful computer virus, ever. +
                > + A computer without a Microsoft operating system is like a dog
                > without bricks tied to its head +
                > + A Microsoft Certified Systems Engineer is to computing what a
                > McDonalds Certified Food Specialist is to fine cuisine +
                >
                >
                > ----- Original Message ----
                > From: Philippe AMELINE <philippe.ameline@...>
                > To: ydn-javascript@yahoogroups.com
                > Sent: Monday, September 10, 2007 7:50:04 AM
                > Subject: Re: [ydn-javascript] Re: YAHOO.util.Dom.getStyle 'height'
                > property NaN for IE 6.0
                >
                > In the same trend, if I define a DIV as an Overlay, with its height
                > defined as 50px in the CSS, I get the following behavior (Firefox and IE):
                >
                > servicesBlock = new YAHOO.widget. Overlay(" controlBlock" , {
                > visible:true,
                > constraintoviewport :false } );
                > servicesBlock. render();
                >
                > var domHeight = YAHOO.util.Dom. getStyle( 'controlBlock' ,'height' ); ->
                > 50px
                > var offsetHeight = $("controlBlock" ).offsetHeight
                > ; -> 50
                > var svcsHeight =
                > servicesBlock. height ->
                > undefined
                >
                > Why do you think that servicesBlock. height returns "undefined"?
                >
                > Philippe
                >
                > Adam Leckron wrote:
                > > yeah, but isn't the point of using the DOM utils is so that you don't
                > > need to worry about browser differences?
                > >
                > > "The Dom Collection comprises a family of convenience methods that
                > > simplify common DOM-scripting tasks, including element positioning
                > > and CSS style management, while normalizing for cross-browser
                > > inconsistencies"
                > >
                > >
                > > --- In ydn-javascript@ yahoogroups. com
                > <mailto:ydn-javascript%40yahoogroups.com>, Matt Sweeney <msweeney@..
                > .> wrote:
                > > >
                > > > When no height is set for IE, getStyle returns "auto". This is due to
                > > > differences between currentStyle (what IE is using) and computedStyle
                > > > (used by other browsers).
                > > >
                > > > You can always get the actual height of an element via offsetHeight,
                > > > provided it is rendered in the document (i.e. not set to
                > > > "display:none" ), but keep in mind that this includes borders and
                > > > padding, which may or may not be the desired effect.
                > > >
                > > > Matt
                > > >
                > > > functionform wrote:
                > > >
                > > > >I'm sure it's me. I have an Event.onAvailable running a method to
                > > > >query the height of a div. the div is the only item in the body tag
                > > > >and it contains some lorem ipsum text. it's height and width are not
                > > > >set explicitly.
                > > > >
                > > > >when I do:
                > > > >YAHOO.util. Dom.getStyle( 'divname' ,'height' )
                > > > >(and parseInt it)
                > > > >
                > > > >I get a number for Firefox, but when I do it for IE, it gives me NaN.
                > > > >(yes I know it's "not a number" ;) ). Does IE require some container
                > > > >div or an explicit height or something else I've missed?
                > > > >
                > > > >It'd be ideal if the height could be picked up dynamically.
                > > > >
                > > > >TIA!
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >Yahoo! Groups Links
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > > >
                > > >
                > >
                >
                >
                >
              • dav.glass@yahoo.com
                Philippe -- servicesBlock.height is an internal reference to the config object height.. It s not the actual height of the Overlay.. servicesBlock.height is the
                Message 7 of 8 , Sep 10, 2007
                • 0 Attachment
                  Philippe --

                  servicesBlock.height is an internal reference to the config object height..

                  It's not the actual height of the Overlay..

                  servicesBlock.height is the equivalent to servicesBlock..cfg.getProperty('height');

                  Which will only return something if you set it either like this:
                  servicesBlock = new YAHOO.widget.Overlay('controlBlock', {
                      height: '50px'
                  });

                  or this:

                  servicesBlock..cfg.setProperty('height', '50px');

                  If you set #controlBlock { height: 50px; } in CSS then you will have to get the height from the element, not the Overlay instance. Like this:

                  YAHOO.util.Dom.getStyle(servicesBlock.element, 'height');

                  servicesBlock.element is a property of the Overlay object that stores an actual DOM reference to the DIV. So by calling servicesBlock.element, you are getting a valid DOM reference..

                  Hope that clears things up :)
                  Dav
                   
                  Dav Glass
                  dav.glass@...
                  blog.davglass.com
                   
                   
                  + Windows: n. - The most successful computer virus, ever. +
                  + A computer without a Microsoft operating system is like a dog
                  without bricks tied to its head +
                  + A Microsoft Certified Systems Engineer is to computing what a
                  McDonalds Certified Food Specialist is to fine cuisine +


                  ----- Original Message ----
                  From: Philippe AMELINE <philippe.ameline@...>
                  To: ydn-javascript@yahoogroups.com
                  Sent: Monday, September 10, 2007 9:31:00 AM
                  Subject: Re: [ydn-javascript] Re: YAHOO.util.Dom.getStyle 'height' property NaN for IE 6.0

                  It helps, thanks!

                  But shouldn't the Overlay object have a valid "height" property when
                  height has been set in the CSS?
                  This "height" property is defined as "CSS height of the Overlay"
                  (http://developer. yahoo.com/ yui/docs/ YAHOO.widget. Overlay.html) but it
                  seems that it contains the property that is set at construction time.

                  In my previous example, if I do :
                  servicesBlock = new YAHOO.widget. Overlay(" controlBlock" , { visible:true,
                  constraintoviewport :false, height:"50px" } )

                  Then servicesBlock. height returns 50

                  Philippe

                  dav.glass@yahoo. com wrote:

                  > Because servicesBlock is a reference to the Overlay object not the DOM
                  > object..
                  >
                  > Try this:
                  >
                  > YAHOO.util.Dom. getStyle( servicesBlock. element, 'height');
                  >
                  > Hope that helps :)
                  > Dav
                  >
                  > Dav Glass
                  > dav.glass@yahoo. com
                  > blog.davglass. com
                  >
                  >
                  > + Windows: n. - The most successful computer virus, ever. +
                  > + A computer without a Microsoft operating system is like a dog
                  > without bricks tied to its head +
                  > + A Microsoft Certified Systems Engineer is to computing what a
                  > McDonalds Certified Food Specialist is to fine cuisine +
                  >
                  >
                  > ----- Original Message ----
                  > From: Philippe AMELINE <philippe.ameline@ free.fr>
                  > To: ydn-javascript@ yahoogroups. com
                  > Sent: Monday, September 10, 2007 7:50:04 AM
                  > Subject: Re: [ydn-javascript] Re: YAHOO.util.Dom. getStyle 'height'
                  > property NaN for IE 6.0
                  >
                  > In the same trend, if I define a DIV as an Overlay, with its height
                  > defined as 50px in the CSS, I get the following behavior (Firefox and IE):
                  >
                  > servicesBlock = new YAHOO.widget. Overlay(" controlBlock" , {
                  > visible:true,
                  > constraintoviewport :false } );
                  > servicesBlock. render();
                  >
                  > var domHeight = YAHOO.util.Dom. getStyle( 'controlBlock' ,'height' ); ->
                  > 50px
                  > var offsetHeight = $("controlBlock" ).offsetHeight
                  > ; -> 50
                  > var svcsHeight =
                  > servicesBlock. height ->
                  > undefined
                  >
                  > Why do you think that servicesBlock. height returns "undefined"?
                  >
                  > Philippe
                  >
                  > Adam Leckron wrote:
                  > > yeah, but isn't the point of using the DOM utils is so that you don't
                  > > need to worry about browser differences?
                  > >
                  > > "The Dom Collection comprises a family of convenience methods that
                  > > simplify common DOM-scripting tasks, including element positioning
                  > > and CSS style management, while normalizing for cross-browser
                  > > inconsistencies"
                  > >
                  > >
                  > > --- In ydn-javascript@ yahoogroups. com
                  > <mailto:ydn- javascript% 40yahoogroups. com>, Matt Sweeney <msweeney@..
                  > .> wrote:
                  > > >
                  > > > When no height is set for IE, getStyle returns "auto". This is due to
                  > > > differences between currentStyle (what IE is using) and computedStyle
                  > > > (used by other browsers).
                  > > >
                  > > > You can always get the actual height of an element via offsetHeight,
                  > > > provided it is rendered in the document (i.e. not set to
                  > > > "display:none" ), but keep in mind that this includes borders and
                  > > > padding, which may or may not be the desired effect.
                  > > >
                  > > > Matt
                  > > >
                  > > > functionform wrote:
                  > > >
                  > > > >I'm sure it's me. I have an Event.onAvailable running a method to
                  > > > >query the height of a div. the div is the only item in the body tag
                  > > > >and it contains some lorem ipsum text. it's height and width are not
                  > > > >set explicitly.
                  > > > >
                  > > > >when I do:
                  > > > >YAHOO.util. Dom.getStyle( 'divname' ,'height' )
                  > > > >(and parseInt it)
                  > > > >
                  > > > >I get a number for Firefox, but when I do it for IE, it gives me NaN.
                  > > > >(yes I know it's "not a number" ;) ). Does IE require some container
                  > > > >div or an explicit height or something else I've missed?
                  > > > >
                  > > > >It'd be ideal if the height could be picked up dynamically.
                  > > > >
                  > > > >TIA!
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > >Yahoo! Groups Links
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > > >
                  > > >
                  > >
                  >
                  >
                  >


                • Philippe AMELINE
                  Cristal clear Dav, I now know that when the doc says CSS height of the Overlay it is just to make fun of nerds like me :-) More seriously, since a container
                  Message 8 of 8 , Sep 10, 2007
                  • 0 Attachment
                    Cristal clear Dav,

                    I now know that when the doc says "CSS height of the Overlay" it is just
                    to make fun of nerds like me :-)

                    More seriously, since a container is an encapsulation of an element, it
                    could be fine:
                    - To have some "getters" available with sound names (getElementHeight,
                    getConstructionHeight, getCSSHeight, getOffsetHeight).
                    - To get read of this problem of margins and padding being included in
                    offset dimensions (offsetHeight and offsetWidth) with IE
                    (getInnerHeight, getGlobalHeight...).

                    Anyway I really appreciate your help.

                    Philippe

                    dav.glass@... wrote:
                    > Philippe --
                    >
                    > servicesBlock.height is an internal reference to the config object
                    > height..
                    >
                    > It's not the actual height of the Overlay..
                    >
                    > servicesBlock.height is the equivalent to
                    > servicesBlock..cfg.getProperty('height');
                    >
                    > Which will only return something if you set it either like this:
                    > servicesBlock = new YAHOO.widget.Overlay('controlBlock', {
                    > height: '50px'
                    > });
                    >
                    > or this:
                    >
                    > servicesBlock..cfg.setProperty('height', '50px');
                    >
                    > If you set #controlBlock { height: 50px; } in CSS then you will have
                    > to get the height from the element, not the Overlay instance. Like this:
                    >
                    > YAHOO.util.Dom.getStyle(servicesBlock.element, 'height');
                    >
                    > servicesBlock.element is a property of the Overlay object that stores
                    > an actual DOM reference to the DIV. So by calling
                    > servicesBlock.element, you are getting a valid DOM reference..
                    >
                    > Hope that clears things up :)
                    > Dav
                    >
                    > Dav Glass
                    > dav.glass@...
                    > blog.davglass.com
                    >
                    >
                    > + Windows: n. - The most successful computer virus, ever. +
                    > + A computer without a Microsoft operating system is like a dog
                    > without bricks tied to its head +
                    > + A Microsoft Certified Systems Engineer is to computing what a
                    > McDonalds Certified Food Specialist is to fine cuisine +
                    >
                    >
                    > ----- Original Message ----
                    > From: Philippe AMELINE <philippe.ameline@...>
                    > To: ydn-javascript@yahoogroups.com
                    > Sent: Monday, September 10, 2007 9:31:00 AM
                    > Subject: Re: [ydn-javascript] Re: YAHOO.util.Dom.getStyle 'height'
                    > property NaN for IE 6.0
                    >
                    > It helps, thanks!
                    >
                    > But shouldn't the Overlay object have a valid "height" property when
                    > height has been set in the CSS?
                    > This "height" property is defined as "CSS height of the Overlay"
                    > (http://developer. yahoo.com/ yui/docs/ YAHOO.widget. Overlay.html
                    > <http://developer.yahoo.com/yui/docs/YAHOO.widget.Overlay.html>) but it
                    > seems that it contains the property that is set at construction time.
                    >
                    > In my previous example, if I do :
                    > servicesBlock = new YAHOO.widget. Overlay(" controlBlock" , {
                    > visible:true,
                    > constraintoviewport :false, height:"50px" } )
                    >
                    > Then servicesBlock. height returns 50
                    >
                    > Philippe
                    >
                    > dav.glass@yahoo. com <mailto:dav.glass%40yahoo.com> wrote:
                    > > Because servicesBlock is a reference to the Overlay object not the DOM
                    > > object..
                    > >
                    > > Try this:
                    > >
                    > > YAHOO.util.Dom. getStyle( servicesBlock. element, 'height');
                    > >
                    > > Hope that helps :)
                    > > Dav
                    > >
                    > > Dav Glass
                    > > dav.glass@yahoo. com <mailto:dav.glass%40yahoo.com>
                    > > blog.davglass. com
                    > >
                    > >
                    > > + Windows: n. - The most successful computer virus, ever. +
                    > > + A computer without a Microsoft operating system is like a dog
                    > > without bricks tied to its head +
                    > > + A Microsoft Certified Systems Engineer is to computing what a
                    > > McDonalds Certified Food Specialist is to fine cuisine +
                    > >
                    > >
                    > > ----- Original Message ----
                    > > From: Philippe AMELINE <philippe.ameline@ free.fr
                    > <mailto:philippe.ameline%40free.fr>>
                    > > To: ydn-javascript@ yahoogroups. com
                    > <mailto:ydn-javascript%40yahoogroups.com>
                    > > Sent: Monday, September 10, 2007 7:50:04 AM
                    > > Subject: Re: [ydn-javascript] Re: YAHOO.util.Dom. getStyle 'height'
                    > > property NaN for IE 6.0
                    > >
                    > > In the same trend, if I define a DIV as an Overlay, with its height
                    > > defined as 50px in the CSS, I get the following behavior (Firefox
                    > and IE):
                    > >
                    > > servicesBlock = new YAHOO.widget. Overlay(" controlBlock" , {
                    > > visible:true,
                    > > constraintoviewport :false } );
                    > > servicesBlock. render();
                    > >
                    > > var domHeight = YAHOO.util.Dom. getStyle( 'controlBlock' ,'height' ); ->
                    > > 50px
                    > > var offsetHeight = $("controlBlock" ).offsetHeight
                    > > ; -> 50
                    > > var svcsHeight =
                    > > servicesBlock. height ->
                    > > undefined
                    > >
                    > > Why do you think that servicesBlock. height returns "undefined"?
                    > >
                    > > Philippe
                    > >
                    > > Adam Leckron wrote:
                    > > > yeah, but isn't the point of using the DOM utils is so that you don't
                    > > > need to worry about browser differences?
                    > > >
                    > > > "The Dom Collection comprises a family of convenience methods that
                    > > > simplify common DOM-scripting tasks, including element positioning
                    > > > and CSS style management, while normalizing for cross-browser
                    > > > inconsistencies"
                    > > >
                    > > >
                    > > > --- In ydn-javascript@ yahoogroups. com
                    > > <mailto:ydn- javascript% 40yahoogroups. com>, Matt Sweeney <msweeney@..
                    > > .> wrote:
                    > > > >
                    > > > > When no height is set for IE, getStyle returns "auto". This is
                    > due to
                    > > > > differences between currentStyle (what IE is using) and
                    > computedStyle
                    > > > > (used by other browsers).
                    > > > >
                    > > > > You can always get the actual height of an element via offsetHeight,
                    > > > > provided it is rendered in the document (i.e. not set to
                    > > > > "display:none" ), but keep in mind that this includes borders and
                    > > > > padding, which may or may not be the desired effect.
                    > > > >
                    > > > > Matt
                    > > > >
                    > > > > functionform wrote:
                    > > > >
                    > > > > >I'm sure it's me. I have an Event.onAvailable running a method to
                    > > > > >query the height of a div. the div is the only item in the body tag
                    > > > > >and it contains some lorem ipsum text. it's height and width
                    > are not
                    > > > > >set explicitly.
                    > > > > >
                    > > > > >when I do:
                    > > > > >YAHOO.util. Dom.getStyle( 'divname' ,'height' )
                    > > > > >(and parseInt it)
                    > > > > >
                    > > > > >I get a number for Firefox, but when I do it for IE, it gives
                    > me NaN.
                    > > > > >(yes I know it's "not a number" ;) ). Does IE require some
                    > container
                    > > > > >div or an explicit height or something else I've missed?
                    > > > > >
                    > > > > >It'd be ideal if the height could be picked up dynamically.
                    > > > > >
                    > > > > >TIA!
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >Yahoo! Groups Links
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > >
                    > > >
                    > >
                    > >
                    > >
                    >
                    >
                    >
                  Your message has been successfully submitted and would be delivered to recipients shortly.