-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemography.js
48 lines (41 loc) · 1.47 KB
/
demography.js
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
$(document).ready(function(){
window.bodyclasses = "undefinedBrowser";
// check if bowser is included
if (typeof bowser == 'undefined') {
console.log("you need to include bowser https://github.com/ded/bowser");
} else {
if (bowser.version != undefined) {
if (bowser.safari === true) {
window.bodyclasses = "safari";
} else if (bowser.msie === true) {
window.bodyclasses = "msie";
} else if (bowser.firefox === true) {
window.bodyclasses = "firefox";
} else if (bowser.chrome === true) {
window.bodyclasses = "chrome";
} else if (bowser.opera === true) {
window.bodyclasses = "opera";
} else if (bowser.iphone) {
window.bodyclasses = "iphone";
} else if (bowser.android) {
window.bodyclasses = "android";
} else if (bowser.ipad) {
window.bodyclasses = "ipad";
}
window.bodyclasses += " " + window.bodyclasses + bowser.version.split(".")[0];
// mobile
if(bowser.mobile != undefined && bowser.mobile === true) {
window.bodyclasses = window.bodyclasses + " mobile";
}
// tablet
if(bowser.tablet != undefined && bowser.tablet === true) {
window.bodyclasses = window.bodyclasses + " tablet";
}
// desktop
if(bowser.tablet == undefined && bowser.mobile == undefined) {
window.bodyclasses = window.bodyclasses + " desktop";
}
}
$("body").addClass(window.bodyclasses);
}
});