Created
June 1, 2012 18:27
-
-
Save folksilva/2854199 to your computer and use it in GitHub Desktop.
JQuery Browser Specific CSS Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!-- Title, meta, jquery 1.4+ etc... --> | |
<script> | |
var browser = $.browser; | |
if(browser == "webkit"){ | |
$("head").append('<link rel="stylesheet" href="safari_or_chrome.css" type="text/css" >'); | |
}else if(browser == "msie"){ | |
$("head").append('<link rel="stylesheet" href="internet_explorer.css" type="text/css" >'); | |
}else if(browser == "mozilla"){ | |
$("head").append('<link rel="stylesheet" href="firefox_or_derived.css" type="text/css" >'); | |
}else if(browser == "opera"){ | |
$("head").append('<link rel="stylesheet" href="opera.css" type="text/css" >'); | |
}else{ | |
$("head").append('<link rel="stylesheet" href="other_or_unknown.css" type="text/css" >'); | |
} | |
</script> | |
</head> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment