DS7/DSWebMobile/Scripts/cssIndex.js

25 lines
2.9 KiB
JavaScript

var screenWidth = screen.width;
var screenHeight = screen.height;
var clientWidth = document.documentElement.clientWidth;
var clientHeight = document.documentElement.clientHeight;
if (screenWidth == 320 && screenHeight == 480) { document.getElementsByTagName("link")[0].href = "../../Content/index_320_480.css"; } //iphone 4 document.getElementsByTagName("link")[0].href = "lib/css/index_640_960.css";
else if (screenWidth == 320 && screenHeight == 568) { document.getElementsByTagName("link")[0].href = "../../Content/index_320_568.css"; } //iphone 5 document.getElementsByTagName("link")[0].href = "lib/css/index_640_1136.css
else if (screenWidth == 375 && screenHeight == 667) { document.getElementsByTagName("link")[0].href = "../../Content/index_480_800.css"; } //iphone 6
else if (screenWidth == 414 && screenHeight == 736) { document.getElementsByTagName("link")[0].href = "../../Content/index_480_800.css"; } //iphone 6 plus
else if (screenWidth == 480 && screenHeight == 800) { document.getElementsByTagName("link")[0].href = "../../Content/index_480_800.css"; }
else if (screenWidth == 480 && screenHeight == 854) { document.getElementsByTagName("link")[0].href = "../../Content/index_480_854.css"; }
else if (screenWidth == 540 && screenHeight == 960) { document.getElementsByTagName("link")[0].href = "../../Content/index_540_960.css"; }
else if (screenWidth == 640 && screenHeight == 960) { document.getElementsByTagName("link")[0].href = "../../Content/index_640_960.css"; }
else if (screenWidth == 640 && screenHeight == 1136) { document.getElementsByTagName("link")[0].href = "../../Content/index_640_1136.css"; }
else if (screenWidth == 720 && screenHeight == 1280) { document.getElementsByTagName("link")[0].href = "../../Content/index_720_1280.css"; }
else if (screenWidth == 720 && screenHeight == 1208) { document.getElementsByTagName("link")[0].href = "../../Content/index_720_1280.css"; }
else if (screenWidth == 750 && screenHeight == 1334) { document.getElementsByTagName("link")[0].href = "../../Content/index_720_1280.css"; }
else if (screenWidth == 768 && screenHeight == 1024) { document.getElementsByTagName("link")[0].href = "../../Content/index_768_1024.css"; }
else if (screenWidth == 800 && screenHeight == 1280) { document.getElementsByTagName("link")[0].href = "../../Content/index_800_1280.css"; }
else if (screenWidth == 1080 && screenHeight == 1920) { document.getElementsByTagName("link")[0].href = "../../Content/index_1080_1920.css"; }
else if (screenWidth == 1242 && screenHeight == 2208) { document.getElementsByTagName("link")[0].href = "../../Content/index_1080_1920.css"; }
else if (screenWidth == 1536 && screenHeight == 2048) { document.getElementsByTagName("link")[0].href = "../../Content/index_1536_2048.css"; }
else if (screenWidth == 1600 && screenHeight == 2560) { document.getElementsByTagName("link")[0].href = "../../Content/index_1600_2560.css"; }
else { document.getElementsByTagName("link")[0].href = "../../Content/index_720_1280.css"; }