Javascript Detecting Screen Resolution

Javascript Detecting Screen Resolution

In this post, I want to share about Javascript Detecting Screen Resolution. In this case you can detect user screen resolution. Javascript Detecting Screen Resolution will be very usefull to help you in designing the layout of your page.

Lets just jump to Javascript Detecting Screen Resolution.

<script language="javascript">
function detect(){
	alert('Width='+screen.width+' \n Height='+screen.height);
}
</script>
<input type="button" value="Detect Resolution" onclick="detect()" />

Indeed, Javascript Detecting Screen Resolution is prety simple code, however it will be powerfull if you combine it with other code while desinging your page.

Just copy the above code into the body of your page, and Javascript Detecting Screen Resolution will be working.

http://septiadi.com/2011/04/27/javascript-detecting-screen-resolution/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: