Link to home
Start Free TrialLog in
Avatar of ddantes
ddantesFlag for United States of America

asked on

Improving media query

Our online reservation system redirects visitors with mobile devices to a dedicated version of the pages, which are (somewhat) optimized for mobile browsing.   However, there are some hybrid devices which may not be technically "mobile", but might still use touch screens.   Currently I'm using detect-smartphone.js to divert mobile visitors, and it is successful, except for devices such as Microsoft Surface.  I wonder if I should be using detect-touchpad.js instead, or in addition, or a different script... detect-smartphone.jsdetect-touchpad.js
Avatar of Brant Snow
Brant Snow

I think alot of this comes down to your approach, i know for my company, we just detect-smartphone.js and use media-queries and responsive to handle normal desktop and tablets.  We have found its really the phones where it starts to be drastically different UI.

Despite this fact we have been moving to all media-queries and responsive, so we dont have to care what type of device is hitting the site.  The other benefit is maintenance, maintaining a seperate somewhat optimized mobile site and be very resource intensive.
Avatar of ddantes

ASKER

Thank you for your comments.  However, I'm unsure how to apply your advice.  Recently, a visitor using Microsoft Surface Pro 3 complained about difficulty using a calendar popup in our reservation system, because it was too small for touchpad performance.  That popup is only meant to appear for desktop/notebook users.  An entirely different layout is presented for tablets and mobile devices, but the desktop/notebook version was presented to this touchscreen user, because detect-smartphone.js treated it as a desktop or notebook.  

Perhaps this is a very uncommon dilemma, and not worth fixing.  Can you address this question?>
I would read this

http://stackoverflow.com/questions/6990070/mobile-redirect-using-screen-resolution

In general the best practices was the user-agent at first, however now since there are so many tablets etc out there on the same operating system it is difficult.

My recommendation would be to use a combination of useragent and resolution size.  Resolution size is a pretty good way to catch all as it is difficult to account for all the possible useragenets.
Avatar of ddantes

ASKER

Thank you.  Can you refer me to a site which provides code for such a combination?
ASKER CERTIFIED SOLUTION
Avatar of ddantes
ddantes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial