我似乎无法找到问题,为什么一切工作,但在低分辨率的JS。我已经扫描了与JS和浏览器相关的问题。即时通讯运行,即10,并减少我的屏幕上我的屏幕为800×600.我的铬在两个屏幕上工作,即resonds到更高的屏幕res ress,但我的较低res屏幕后高分辨率设置,如跳过较低的分辨率。IE浏览器JavaScript和CSS问题
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"
>
<html lang="en">
<head>
<title></title>
<!--[if IE]>
<script type="text/JavaScript">
if (screen.height <= 800) {
document.write('<link rel="stylesheet" type="text/css" href="ie_low.css" />');
}
else {
document.write('<link rel="stylesheet" type="text/css" href="ie.css" />');
}
</script>
<![endif]-->
<script type="text/JavaScript">
var screenheight = screen.height;
if (screenheight <= 800) {
document.write('<link rel="stylesheet" type="text/css" href="style_low.css">');
}
else {
document.write('<link rel="stylesheet" type="text/css" href="style.css">');
}
</script>
<style>
</style>
</head>
<body>
<div class="container">
<div class="header">
</div>
<div class="title">
<img src='logo.png' class="logo" alt='logo'>
</div>
<div class="main">
</div>
</div>
</body>
</html>
你不需要使用JavaScript的这一点 - 这是什么样的是CSS媒体查询是专门做的事情。 (IE8不支持媒体查询,但有办法解决这个问题)请参阅http://caniuse.com/css-mediaqueries – SDC 2013-02-28 17:07:15
IE10不支持条件注释,因此您的IE脚本从不执行。 – Teemu 2013-02-28 17:09:25