-1

In addition to the Viewport-Size (viewportSize.js) and the Device-Size (getDevicePixelWidth.js) I have to know if the user device is a mobile or a desktop operating system. For expl. I have to differ between a table with android or other mobile os and windows 8 or Linux desktop os and android or MacOS and iOS and so on. Yesterday I googled a lot and read many statements, so I'm confused, cause some say, I should use: (navigator.appVersion or navigator.userAgent other say that aint good progr. practice. I need a lightweight reliable solution. Does anyone know?

Tom
  • 13
  • 5
  • 1
    "I have to know if the user device is a mobile or a desktop operating system" -- why? – CommonsWare Mar 22 '14 at 17:12
  • Some kind of javascript extensions are running on desktop power quite nice and make my website looking good. On most mobile os devices regardless of pixel resolution its looking awfull. So I want to deactivate that js extensions for mobile os users. The device pixel width is insufficient information! – Tom Mar 22 '14 at 17:19
  • 1
    I would recommend that you find out what your real problem is and fix it, rather than assuming all desktops work and all mobiles do not work. – CommonsWare Mar 22 '14 at 17:31
  • If you can't answer my question, thats no problem to me, but downrating my question is!! I use parallax scrolling, that's fine on desktop PCs but it is not realy needet on mobile devices. – Tom Mar 22 '14 at 18:42
  • I did not "downrate" your question. As to whether parallax scrolling is relevant for mobile devices, note that there are Android tablets and all-in-one devices with screen sizes meeting or exceeding "desktop" monitors. And there are desktops and notebooks with touchscreens, akin to mobile devices. Hence, it is rather unclear why you think parallax scrolling is tied to mobile devices rather than some more valuable characteristic (screen size, whether or not the device is a touchscreen, etc.). – CommonsWare Mar 22 '14 at 19:00
  • Parallax scrolling may be nice and I would like to give it a try on my new website project. But I don't realy need that to say what I want to say. I saw the site on android tablets with 1280 pixel width but the loaded page hang completly. I had to deactivate the used lib (skrollr.js) so I could use the page. – Tom Mar 22 '14 at 19:08
  • So I guess mobile browser and perhaps operating systems may have problems with very engaged grafic processing scripts. My conclusion is to deactivate that script, when using mobile browser on andorid and other mobile osses. I won't test them all. – Tom Mar 22 '14 at 19:15
  • Hence, your problem isn't "mobile os devices", but specific browsers with specific compatibility issues. You could experience the same "loaded page hang completely" on Opera running on OS X, IE6 on Windows XP, older single-core PCs, etc. Until you determine exactly what the problem is, you are just guessing that handling mobile devices differently will magically solve all occurrences of this problem. – CommonsWare Mar 22 '14 at 19:17
  • No, not all occurrences of that probelm, but I have to decide how many versions I want to make and have the time to do. So I decided I make one solution for mobile (slower systems) and another for desktop systems but in both cases the site have to transport the content to the user thats important to him to get, parrallax scrolling is it not! If you can tell me a lightweight way to dig a better decission for my issue I would like to check it out. – Tom Mar 22 '14 at 19:31
  • I found an interesting question with answers to it concerning my own question put in that thread: http://stackoverflow.com/questions/15391009/detect-graphics-card-performance-js – Tom Mar 22 '14 at 20:29

1 Answers1

0

You could use the jquery-browser-plugin to detect if mobile or desktop.

andreasbecker.de
  • 533
  • 2
  • 12