问题
I'm trying to make a 'css hack' that will allow me to change css depending on a user's OS.
For Mac and iOS I want one style, for everything else (Windows, Linux, Android, etc...) I want a different style.
So far I've cobbled together this:
if (navigator.platform = :not("MacIntel")) {
$("p").css("font-size", "50px");
}
But, I'm not sure how to take it further.
What I want to do is say: if not Mac or iOS, then change the css font size element.
Any idea how i can do this?
I've made a jsFiddle here:
- http://jsfiddle.net/b9r5G/
As I've said above, I've got it half working... I need help getting it to 100%.
Thanks!
回答1:
Saw something here:How to detect mobile browser using jQuery or in some other SIMPLE way..?
var android = (navigator.platform.indexOf("android")>=0); //true if android
来源:https://stackoverflow.com/questions/15421788/if-not-my-operating-system-change-css-jquery