device-detection

Detecting a retina display iPad with javascript

坚强是说给别人听的谎言 提交于 2019-12-06 05:26:14
问题 I'm having a problem detecting a retina iPad (and similar devices) using just screen.availWidth and window.devicePixelRatio . The problem is that iPhones and iPads give the number of dips for screen.availWidth whereas android devices seem to report the number of physical pixels so I can't reliably do screen.availWidth / window.devicePixelRatio to calculate if the screen is of a tablet size. Is there some other DOM property I can use to help me? edit - To sum up in a way which hopefully makes

A check in JavaScript that returns whether I am on a smartphone? [duplicate]

痞子三分冷 提交于 2019-12-01 03:03:58
问题 This question already has answers here : What is the best way to detect a mobile device? (52 answers) Closed 5 years ago . I want to perform a check in one of my JavaScript functions that determines whether I am on a smartphone and then decide whether or not to run the function based on the results. What is the best way to detect/check for a smartphone (or handheld device in general) in JavaScript? e.g. if (user is on a smartphone) { //run this code if on a phone } else { //run this code if

how to identify if user agent is windows 8 tablet?

陌路散爱 提交于 2019-11-30 22:39:50
I have a web application. I my JavaScript, I am identifying devices by user agent string as follows: _android = navigator.userAgent.toLowerCase().indexOf("android"); _iOS = navigator.platform.indexOf("iPhone"); My task is to identify if device is win8 tablet or not? I have already seen this post . But, the string "Windows NT" is likely to appear in useragent on all the PC browsers. So, I need to find out a client side way of identifying if device is win8 tablet? Any thoughts? You can't identify if it is a tablet or not, but you can identify if it has touch or not. This is the IE user agent

Detect phone/tablet/web client using javascript

柔情痞子 提交于 2019-11-30 08:37:31
问题 I am trying to detect if the end user is on a phone, a tablet or a pc I have been Googling for a while, apparently there are no easy solution. Well I guess I should not use Resolution, since nowadays some tablets have amazing resolutions. I should not rely on orientation, because windows8 laptops can just rotate like tablets. (and responsive design is just too difficult for my current project) I've been trying to use UserAgent(thought it has its drawbacks too), but can not get it working,

Best Open Source WURFL alternative [closed]

心已入冬 提交于 2019-11-29 22:57:54
I am looking to do some device detection in PHP and I am looking into a few options. The one that looks the best right now is WURFL http://wurfl.sourceforge.net/ . But I am very leery of it because of its non open source license. I am also wondering if it is even relevant because the documentation websites look kind of dated. Other options like WURFL include http://deviceatlas.com/ and http://51degrees.mobi/ but neither of these are even close to open source. Then there are the PHP only solutions like http://detectmobilebrowsers.mobi , http://code.google.com/p/php-mobile-detect/ and http:/

Detecting mobile browsers on the web?

*爱你&永不变心* 提交于 2019-11-29 05:06:46
I'm curious to know how to check for iPhone, iPad and other mobile browsers.(JavaScript or CSS) Edit: Not user agent string, please. That can be faked. Possible Dupes: Auto detect mobile browser (via user-agent?) and Standard way to detect mobile browsers in a web application based on the http request Basically you check the User Agent String see http://www.hand-interactive.com/resources/detect-mobile-javascript.htm Detect iPhone: navigator.userAgent.toLowerCase().search("iphone") > -1 In general feature detection is better than browser detection it is better to know what the user's browser

Detecting mobile browsers on the web?

僤鯓⒐⒋嵵緔 提交于 2019-11-27 22:47:14
问题 I'm curious to know how to check for iPhone, iPad and other mobile browsers.(JavaScript or CSS) Edit: Not user agent string, please. That can be faked. Possible Dupes: Auto detect mobile browser (via user-agent?) and Standard way to detect mobile browsers in a web application based on the http request 回答1: Basically you check the User Agent String see http://www.hand-interactive.com/resources/detect-mobile-javascript.htm Detect iPhone: navigator.userAgent.toLowerCase().search("iphone") > -1

Detect mobile devices - and tablet devices

喜你入骨 提交于 2019-11-27 12:25:24
I am currently looking at some code for PHP detection of mobiles, which is probably quite easy. Now I just have got one problem - I want to make it possible to make unique view-files in my MVC-framework for tablets, mobiles and web pages. So I need to split the tablet from the rest of the mobile devices. Currently this is the code, that I am using: public function isMobile() { if(preg_match('/(alcatel|amoi|android|avantgo|blackberry|benq|cell|cricket|docomo|elaine|htc|iemobile|iphone|ipad|ipaq|ipod|j2me|java|midp|mini|mmp|mobi|motorola|nec-|nokia|palm|panasonic|philips|phone|sagem|sharp|sie-

Using Modernizr to test for tablet and mobile - Opinions wanted

♀尐吖头ヾ 提交于 2019-11-27 12:02:30
I want to use Modernizr to detect whether a user is view a site on a desktop, tablet or mobile device. My initial first thoughts are obviously to check screen sizes that should be enough for mobile devices and also for larger desktops. For tablet devices where the screen size could also equal that of a small desktop screen (1024 x 768) I would test for touch events as well. At this time I would like to focus on mobile/tablet devices that, as jQuery mobile puts it are, A-grade. I am not looking to tap in to any specific mobile device features simply detect desktop, tablet or mobile and serve up

How to detect which device view you're on using Twitter Bootstrap API?

馋奶兔 提交于 2019-11-27 10:36:31
I have just started to play around with Twitter Bootstrap API for a project I have coming up. The main nav contains 3 main elements: site nav social links nav search the site form I am using the collapse plugin to collapse the site nav and search form when viewing the site on mobile devices. The mobile view has 2 buttons which when clicked toggle the search form or main nav on/off. However if I toggle off the search form and then resize my browser to desktop view the search form is still hidden in this view? I have read about using classes such as visible-mobile etc but these seem to clash