3

Is there a way to detect Win OS vs Mac and re-direct a site to a different version for each?

We have built a parallax intro for a clients site using superscrollorama and the scroll speed between mac and pc browsers is massive - takes a few mins on pc as apposed to few seconds on the imac.

Easy to alter for each but i need a way to detect and re-direct the sites in the first place.

Any suggestions?

3
  • 4
    This may not be the kind of answer you're looking for and I'm honestly not trying to be snarky, but have you considered trying to optimise the code? To write off an entire operating system because of a perceived performance problem seems ridiculous! Commented Jan 24, 2013 at 12:22
  • 1
    Are you certain the problem is Mac vs Windows and not, for example, 3D accelerated graphics card vs non-accelerated graphics card? Commented Jan 24, 2013 at 12:37
  • 1
    Even if the OS is the real issue here, your question covers Windows and OS X. What about Linux, iOS, Android, iOS, the OS used by Playstation 3, the OS used by Smart TVs with browsers, etc? Commented Jan 24, 2013 at 12:38

2 Answers 2

20
var OSName="Unknown OS"; if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows"; else if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS"; else if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX"; else if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux"; console.log('Your OS is: '+OSName); 
Sign up to request clarification or add additional context in comments.

Comments

-1

if you use java, you can use the following code:

System.getProperty("os.name")

and will get String like:

"Windows 10" Or "Mac OS X"

and then,it can be used for you specific purpose

1 Comment

I mean. The question is for jquery, html, css, html5 and not Java

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.