-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
29 lines (19 loc) · 801 Bytes
/
main.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
function cssandjschange() {
let ua = navigator.userAgent.toLowerCase();
let isMobile = ua.indexOf("mobile") !== -1 || ua.indexOf("android") !== -1 || ua.indexOf("iphone") !== -1 || ua.indexOf("ipad") !== -1;
if(isMobile === true){
const script = document.createElement('script');
script.id = 'mobile_script';
script.src = 'scripts/mobile_script.js';
document.head.appendChild(script);
document.getElementById('css_sheet').href="css/mobile_style.css";
}
else {
const script = document.createElement('script');
script.id = 'pc_script';
script.src = 'scripts/pc_script.js';
document.head.appendChild(script);
document.getElementById('css_sheet').href="css/pc_style.css";
}
}
cssandjschange();