Results 1 to 3 of 3

Thread: Get Screen Dimensions

  1. #1

    Thread Starter
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772

    Get Screen Dimensions

    How can i get the screen size of the user's monitor?
    Alcohol & calculus don't mix.
    Never drink & derive.

  2. #2

    Thread Starter
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    Never mind, I found out. If anyone is interested, it is screen.height and screen.width.
    Alcohol & calculus don't mix.
    Never drink & derive.

  3. #3
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    *Note, i did not write this:

    Code:
    <html>
    <head><title>Your Page Title Goes Here!</title>
    </head>
    
    <script  language="JavaScript">
    <!--
    /* Note that screen height and screen width refers to the size of the
       monitor (as opposed to the browser window). */
    var screen_width = null;
    var screen_height = null;
    var resolution = null;
    // -->
    </script>
    <script language="JavaScript1.2">
    <!--
    screen_width = screen.width;
    screen_height = screen.height;
    // -->
    </script>
    <script language="JavaScript1.1">
    <!--
    if (navigator.appName == "Netscape" && navigator.javaEnabled()) {
     var toolkit = java.awt.Toolkit.getDefaultToolkit();
     if (!screen_width) {
      var screen_size = toolkit.getScreenSize();
      screen_width = screen_size.width;
      screen_height = screen_size.height;
     }
     resolution = toolkit.getScreenResolution();
    }
    // -->
    </script>
    <script  language="JavaScript">
    <!--
    if (screen_width && screen_height) {
     if (!resolution) {
      // Screen width and height have been calculated.
      // You may do whatever you wish with the three calculations here.
      // The example below transfers to another page based on the
      // width of the screen:
      if (screen_width < 700)
       document.write(screen_width+"x"+screen_height);
      else if (screen_width < 900)
      document.write(screen_width+"x"+screen_height);
      else
      document.write(screen_width+"x"+screen_height);
     } else {
      // Screen width, height, AND resolution have been calculated.
      // You may do whatever you wish with the three calculations here.
      // The example below transfers to another page based on the
      // width of the screen:
      if (resolution < 80)
      document.write(screen_width+"x"+screen_height);
      else
      document.write(screen_width+"x"+screen_height);
     }
    } else {
     // screen width, height, or resolution could not be calculated
     // default action goes here
     document.write("<table width=486><tr><td><font color='red'>"
      + "You do not have Java properly installed in order to facilitate "
      + "parsing your screen size and resolution."
      + "</font></td></tr></table>");
    }
    // -->
    </script>
    
    
    </html>

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width