0

I've been researching for a good way to get the devicetype to trigger mobile websites and many people still use script that gets the screen width/height in pixels to determine if mobile devices are used or not.

But mobile phones/tablets have extremely high resolution screens so we need to get another way to trigger a switch between normal websites and mobile websites. Screen sizes are around 1,280 x 768 - 1920x1080 for mobile phones and 1920x1080 to 2560x1600 for tablets.

What is the correct error-proof method to determine mobile or not? I'd like not to use javascript over php, if there's an easier method then javascript please tell!

Kara
  • 5,650
  • 15
  • 48
  • 55
Jeroen Vorsselman
  • 733
  • 1
  • 6
  • 18
  • The main problem is: What is your definition of "mobile"? Have you read through [this](http://stackoverflow.com/questions/3514784/best-way-to-detect-handheld-device-in-jquery) question? Also, see [Bart's answer](http://stackoverflow.com/questions/3514784/best-way-to-detect-handheld-device-in-jquery#3515311) which is very good IMO. – Uooo Mar 04 '13 at 11:48

1 Answers1

0

you can make the mobile website responsive trough Media Queries in your CSS It will overwrite your normal CSS for the website. Media Queries will check for resolutions and what you put in the media query will be shown like that in a resolution like that http://webdesignerwall.com/tutorials/css3-media-queries

With Javascript you can do check the browser with the code I found on this page: http://www.abeautifulsite.net/blog/2011/11/detecting-mobile-devices-with-javascript/

with that code you can redirect to a website specially designed for mobile website

Matthias Wegtun
  • 1,221
  • 9
  • 13