Created
March 2, 2017 08:41
-
-
Save myvitaliy/cab961135a068c97d4c4e024015fb24f to your computer and use it in GitHub Desktop.
Скрипт определения браузера
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
var is_chrome = navigator.userAgent.indexOf('Chrome') > -1; | |
var is_explorer = navigator.userAgent.indexOf('MSIE') > -1; | |
var is_firefox = navigator.userAgent.indexOf('Firefox') > -1; | |
var is_safari = navigator.userAgent.indexOf("Safari") > -1; | |
var is_opera = navigator.userAgent.toLowerCase().indexOf("op") > -1; | |
if ((is_chrome)&&(is_safari)) {is_safari=false;} | |
if ((is_chrome)&&(is_opera)) {is_chrome=false;} | |
/* end detect browser*/ | |
if(is_opera) { | |
$('body').addClass('is_opera'); | |
} | |
if(is_chrome) { | |
$('body').addClass('is_chrome'); | |
} | |
if(is_firefox) { | |
$('body').addClass('is_firefox'); | |
} | |
if(is_safari) { | |
$('body').addClass('is_safari'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment