如果不是“我的操作系统”更改css - jquery [英] if not "my operating system" change css - jquery
问题描述
我想设置一个css hack ,这将允许我根据用户的操作系统更改css。
I'm trying to make a 'css hack' that will allow me to change css depending on a user's OS.
Mac和iOS我想要一种风格,对于其他一切(Windows,Linux,Android等...)我想要一个不同的风格。
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.
我想做的是说:如果不是Mac或iOS,那么更改css字体大小元素。
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?
我在这里做了一个jsFiddle:
I've made a jsFiddle here:
- http://jsfiddle.net/b9r5G/
正如我上面所说,我有它的一半工作...我需要帮助得到它100%。
As I've said above, I've got it half working... I need help getting it to 100%.
谢谢!
推荐答案
http://stackoverflow.com/questions/5045615/how-to-detect-mobile-browser-using-jquery-or-in-some-other-simple-way\">如何使用jQuery或在某些情况下检测移动浏览器其他SIMPLE方式?
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
这篇关于如果不是“我的操作系统”更改css - jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!