首页 > Web开发 > 详细

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

时间:2015-06-16 14:26:14      阅读:209      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!