It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

JavaScript Screen Detection?

JavaScript Screen Detection?

Postby maltepeter on Thu Aug 11, 2011 10:55 pm

I would like to detect the user's screen resolution, and if it is less than 1024x768, display an alert saying that they should adjust their screen resolution. Also, how to include it on my webpage, i think it only needs to appear on the home page.

Thanks for any help!
maltepeter
 
Posts: 2
Joined: Wed Aug 10, 2011 2:59 pm

Re: JavaScript Screen Detection?

Postby rajmv on Sat Aug 20, 2011 6:43 pm

Code: Select all
<html>
<head>
</head>
<body>


<script type="text/javascript">
   if (screen.height<768 || screen.width<1024) alert ("Your screen's resolution is below 1024x768. This site works better at higher resolutions.");
</script>
</body>
</html>
rajmv
100+ Club
 
Posts: 103
Joined: Thu Jul 14, 2011 7:22 am


Who is online

Users browsing this forum: No registered users and 7 guests