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

<link rel="stylesheet" type="text/css" id="css">

<script language="javascript">
function dis(){
  if((screen.width == 1920) && (screen.height == 1080)){
    document.getElementById('css').href = '2.css';
  }else if ((screen.width == 1366) && (screen.height == 768)){
    document.getElementById('css').href = '1.css' ;
  }else{
    document.getElementById('css').href = '1.css';
  }
}

dis();
</script>

posted @ 2012-12-10 09:04  白*开*水  阅读(449)  评论(0编辑  收藏  举报