forked from unk/IE-Checker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathie-checker.js
More file actions
30 lines (30 loc) · 721 Bytes
/
ie-checker.js
File metadata and controls
30 lines (30 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*!
* IE-Checker v1.0
* http://grotesq.com
*
* Author : Kim Naram ( a.k.a. Unknown )
* Email : unknown@grotesq.com
*
* Copyright 2007-2014 The GrotesQ
* Released under the MIT license
*
* Date: 2014-07-29 18:38
*/
;( function() {
var ua = navigator.userAgent.toLowerCase();
if( ua.indexOf( 'msie' ) != -1 || ua.indexOf( 'trident' ) != -1 ) {
var version = 11;
ua = /msie ([0-9]{1,}[\.0-9]{0,})/.exec( ua );
if( ua )
{
version = parseInt( ua[ 1 ] );
}
var classNames = '';
classNames += ' is-ie';
classNames += ' ie' + version;
for( var i = version + 1; i <= 11; i++ ) {
classNames += ' lt-ie' + i;
}
document.getElementsByTagName( 'html' )[ 0 ].className += classNames;
}
} )();