Blog > detail

Just my tiny mind

Javascript Detecting Screen Resolution

26-2-2012 Admin General 2 Comments

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 the script.


<script type="text/javascript" language="javascript">// <![CDATA[

function detect(){

alert('Width='+screen.width+' \n Height='+screen.height);

}

// ]]></script>

<input onclick="detect()" type="button" value="Detect Resolution" />


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.

Javascript Detecting Screen Resolution

Javascript Detecting Screen Resolution

word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word

Javascript Detecting Screen Resolution

Javascript Detecting Screen Resolution

Javascript Detecting Screen Resolution