Mega Code Archive

 
Categories / JavaScript Tutorial / Screen
 

Check screen resolution

< html> <head> <script language="JavaScript" type = "text/javascript"> <!-- if (screen.width == 640){   alert("Resolution is 640 by 480"); } else if(screen.width == 800) {   alert("Resolution is 800 by 600"); } else if (screen.width == 1024){   alert("Resolution is 1024 by 768"); } else if (screen.width > 1024){    alert("Resolution is greater than 1024 by 768"); } //--> </script> </head> <body> </body> </html>