Is there a native JavaScript (or through the use of a library such as JQuery/Modernizr etc) way to detect if a device is capable of changing orientation? I would like to use that as a method to differentiate between desktop and mobile.
Thanks,
Shadi
Detecting mobile devices:
Simple browser sniffing
jQuery.browser.mobile plug-in (exhaustive browser sniffing)
Simple test for touch events
Advanced test for touch events:
Optionally use
onorientationchange
for #3 and #4 above.Combine 1 or more of these (and any other approaches) as needed. None of them are foolproof.