用jquery判断当前显示器的分辨率,加载不同CSS

<link rel="stylesheet" type="text/css" id="css">
<script language="javascript">
function dis()
{
if((screen.width == 1024) && (screen.height == 768))
{
document.getElementById('css').href = '2.css';
}else if ((screen.width == 800) && (screen.height == 600))
{
document.getElementById('css').href = '1.css' ;
}else
{
document.getElementById('css').href = '2.css';
}
}

dis();

</script>

原文地址:https://www.cnblogs.com/jxgxy/p/2744852.html