jQuery OS Detection
2010-01-28 06:11:19 | 7 Comments
Windows doesn't have Lucida Grande font by default so my visitors from Windows was reading my posts with the default browser font. I wanted to change the font-family property for Windows users from Lucida Grande to Lucida Sans Unicode. I have searched and found a plugin to detect client's operating system with jQuery.
Many thanks go to [Stoimen](http://www.stoimen.com/blog/) for this plugin. You can download the plugin [here](http://www.stoimen.com/blog/2009/07/16/jquery-browser-and-os-detection-plugin/) and you can see the plugin in action [here](http://stoimen.com/jquery.client.plugin/).
Usage of the plugin is very simple. $.client.os returns the client's operating system and $.client.browser returns the client's browser. How I used this plugin is also very simple:
$(document).ready(function(){
if ($.client.os == "Windows")
{
$(".post").css('font-family', 'Lucida Sans Unicode, sans-serif');
}
});
Again, I'd like to thank Stoimen for this plugin.
Check my latest project compector.com where you can post references about your former employers and see what others have said about the future employers. Sign up now and post a reference and share it on twitter or facebook.


Comments
Leave a Response