script for screen resolution

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
ToZero
Forum Newbie
Posts: 1
Joined: Mon Aug 26, 2002 3:12 pm
Location: Belgium

script for screen resolution

Post by ToZero »

Hello!

:?: I'm looking for a (php)-script which gives a popup-screen when the visitors screen resolution is smaller than the usual 1024x786. Who can give me such script, or websites where I can find something equal?

:!: Tnx!

To
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Ahh here it is but you should have posted in Client Side Forum.

Code: Select all

<script language="Javascript" type="text/javascript">
<!--
  var sWidth = screen.width;
  var sHeight = screen.height;

  if(sWidth < 1024 && sHeight < 768) &#123;
    widow.alert("You are using a screen smaller than 1024x768");
    window.open("screen.html","Screen", "toolbar=no, location=no,direcotries=no,width=300,height=250");
  &#125;
//-->
</script>
This will create an alert window if it less than 1024x768 and then open screen.html in new window
Post Reply