Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get screen resolution on a mobile website

Tags:

People also ask

How do I check the resolution of a website?

To use our responsive website checker, simply copy and paste the URL of your web page on the space provided on this link http://smallseotools.com/screen-resolution-simulator/; then, select the type of resolution that you wish to view and click on the “Check” button; then, our online screen resolution simulator will ...

How can you check the appearance of your webpage on different mobile screen sizes?

Screenfly is a free tool for testing a website on different screen sizes and different devices. It's been around for a few years now, but it's still popular and does its job extremely well. Just enter your URL, pick your device and screen size from the menus and you'll see how well your website is working on it.


I am designing a mobile website that has a section to download wallpapers from. In order to accommodate many users, I wish to make it possible to download a wallpaper based on the screen resolution. I want to detect resolution from JavaScript and show the appropriate wallpaper.

This is what I found online and tried and failed xD:

width  = window.innerWidth  || document.body.clientWidth
height = window.innerHeight || document.body.clientHeight;

For my SGS3, which has the resolution 720x1280 I get the 360x567.

How should I discover the resolution of the phone from JavaScript?