Last active
August 29, 2015 14:11
-
-
Save marioblas/e6184867bfd9e9cf26b8 to your computer and use it in GitHub Desktop.
HTML/SCSS/Javascript - Detect IE version
This file contains hidden or 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
<!doctype html> | |
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]--> | |
<!--[if IE 7 ]> <html class="ie7"> <![endif]--> | |
<!--[if IE 8 ]> <html class="ie8"> <![endif]--> | |
<!--[if IE 9 ]> <html class="ie9"> <![endif]--> | |
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]--> | |
<head> |
This file contains hidden or 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
var oldIE = ( $('html').is('.ie6, .ie7, .ie8') ) ? true : false; | |
if ( oldIE ) { | |
// Do something for old IE versions | |
} | |
else { | |
// Do something for every one else | |
} |
This file contains hidden or 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
.ie6 { /* Styles for IE6 */ } | |
.ie7 { /* Styles for IE7 */ } | |
.ie8 { /* Styles for IE8 */ } | |
.ie9 { /* Styles for IE9 */ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment