码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2015-06-16 14:27:41      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:

<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>

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

标签:

原文地址:http://www.cnblogs.com/sky6699/p/4580511.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!