IE doesn't support CSS3 columns. I want to use a jQuery columnizer in IE and CSS3 in all other browsers. How can I do this?
3 Answers
You should include a conditional script in your page
<!--[if IE]>
<script type="text/javascript">
// script for IE
</script>
<![endif]-->
You can also target different versions of IE with this method
2 Comments
Jared Eitnier
Thanks. Going with if($.browser.msie).
Matt Esch
I should probably also mention the use of the if condition allows you to include different stylesheets as well, such as a CSS2 stylesheet for earlier versions of IE if you need to, just wrap the statement for including the css in your head with the if statement. There are also slight performance benefits to not using javascript to detect the browser version and execute some code conditionally. Chrome or Firefox won't even download the script file that contains your IE code.
You can try CSS3 & HTML5 feature detection using modernizr and do conditional resource loading. It's more powerful than browser sniffin'.