Getting size of window?

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

    Getting size of window?

    Hi,

    What is the correct way to get the dimensions of the displayable window?
    I.e. I don't want the border or the toolbar to be included in the height
    or width.

    I want to request an image from a php page by passing arguments for
    height and width so that will be rendered to fit exactly in the window.

    Thanks for any help.

  • Bart Van der Donck

    #2
    Re: Getting size of window?

    Locke wrote:
    What is the correct way to get the dimensions of the displayable window?
    I.e. I don't want the border or the toolbar to be included in the height
    or width.
    >
    I want to request an image from a php page by passing arguments for
    height and width so that will be rendered to fit exactly in the window.
    >
    Thanks for any help.


    --
    Bart

    Comment

    • Locke

      #3
      Re: Getting size of window?

      http://www.jibbering.com/faq/#FAQ4_9
      >
      Thanks, but none of those methods worked for me in IE 6.

      The DOM method worked great in firefox and on my cell phone.

      document.docume ntElement.clien tHeight in firefox returns the height that
      the content spans, not the height of the window :(

      I need a solution that will work across all common browsers and
      hopefully most cell phones. I assume at the moment this is not possible?

      Thanks

      Comment

      • Lee

        #4
        Re: Getting size of window?

        On Jun 3, 2:05 pm, Locke <jlo...@www.com wrote:
        >
        Thanks, but none of those methods worked for me in IE 6.
        >
        The DOM method worked great in firefox and on my cell phone.
        >
        document.docume ntElement.clien tHeight in firefox returns the height that
        the content spans, not the height of the window :(
        >
        I need a solution that will work across all common browsers and
        hopefully most cell phones. I assume at the moment this is not possible?
        >
        Thanks
        document.body.c lientHeight and document.body.c lientWidth seems to work
        fine on IE6, Firefox and Opera. Thats all I tested though.

        Comment

        • Locke

          #5
          Re: Getting size of window?

          Lee wrote:
          On Jun 3, 2:05 pm, Locke <jlo...@www.com wrote:
          >Thanks, but none of those methods worked for me in IE 6.
          >>
          >The DOM method worked great in firefox and on my cell phone.
          >>
          >document.docum entElement.clie ntHeight in firefox returns the height that
          >the content spans, not the height of the window :(
          >>
          >I need a solution that will work across all common browsers and
          >hopefully most cell phones. I assume at the moment this is not possible?
          >>
          >Thanks
          >
          document.body.c lientHeight and document.body.c lientWidth seems to work
          fine on IE6, Firefox and Opera. Thats all I tested though.
          >
          In firefox, the error console gives the following message:

          Error: document.body has no properties
          Source File: file:///.../dim2.html
          Line: 4

          Source:

          <html>
          <script>

          var winWidth = document.body.c lientWidth;
          var winHeight = document.body.c lientHeight;


          document.write( winWidth + " x " + winHeight);

          </script>
          </html>

          Comment

          • Locke

            #6
            Re: Getting size of window?

            In firefox, the error console gives the following message:
            >
            Error: document.body has no properties
            Source File: file:///.../dim2.html
            Line: 4
            >
            Never mind, its because I didn't have a <bodysection, whoops!

            Works now, thanks!

            Comment

            Working...