Results 1 to 2 of 2

Thread: Screen Resolution

  1. #1

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268

    Question

    I need some code that will determine the screen resolution of the user visiting my site and alter it accordingly.
    Here's a VBScript example of what I need:
    Code:
    If [Screen Resolution] > "800x600" Then Document.Write "<BR>"
    I don't really know my VBScript or Javascript very well, so please excuse whatever mistakes I've made in the coding. But I'm sure you know what I mean.
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    You want the javascript screen.width and screen.height properties.

    This should point you in the right direction....

    Code:
    <HTML>
    <HEAD>
    <script language="JavaScript"><!--
    function Doit(){
     if (screen.width > 800){
    	if (screen.height > 600){
    
    	alert();
           }
    }
    }
    //--></script>
    </HEAD>
    <body onload="Doit()">
    
    
    </BODY>
    
    </HTML>
    Mark
    -------------------

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