Tutorials-Nuval Web Design

  • Increase font size
  • Default font size
  • Decrease font size
Home Web Design Detecting screen resolution

Detecting screen resolution

E-mail Print PDF

I recently came across a project where it was necessary to determine the monitor resolution so that some Flash movies would display correctly. If you want to get the dimensions for the user's monitor, you can use Javascript's screen.width and screen.height properties to get the dimensions in pixels. As a check, you can use the following:

<SCRIPT LANGUAGE = JavaScript> 
document.write("Here's the screen width:" + screen.width + "and your screen height:" + screen.height + ".");  
</SCRIPT>

Please note this is different than the browser height/width.

 

Last Updated on Monday, 25 January 2010 02:19  

Polls

Favorite Web Page Authoring Software?