根据显示器的分辨率,加载不同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>

posted on 2013-08-14 16:33  骑蟋蟀的蝈蝈  阅读(396)  评论(0)    收藏  举报

导航