Skip to content

Instantly share code, notes, and snippets.

@ornj
Created April 24, 2013 19:48
Show Gist options
  • Save ornj/5455004 to your computer and use it in GitHub Desktop.
Save ornj/5455004 to your computer and use it in GitHub Desktop.
Modernizr < IE9 test. Some times you have to do what you have to do.
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class=""> <!--<![endif]-->
/**
* Check if browser is IE less than 9. Due to the IE conditions in the HTML, non-Internet Explorer
* browsers will always have false returned.
*/
Modernizr.addTest('ltie9', function() {
return (document.getElementsByTagName('html')[0].className.indexOf('lt-ie9') > -1) ? true : false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment