function loadLink(filename) {
var page = document.documentElement;
var width = page.clientWidth;
if (width > 1080) {
url = '../css1/' + filename
} else {
url = '../css/' + filename
}
var link = document.createElement('link');
link.rel = 'StyleSheet';
link.type = 'text/css'
link.href = url;
var hed = document.getElementsByTagName('head')[0];
hed.appendChild(link)
}
//需在html中引入 如:
<script
loadLink(‘tool.css’)
loadLink(‘appointment_ensure.css’)
< /script>
在css / css1 文件夹下去找到相对应的样式