[英]respond.js not working on IE8
有很多主题,但是我找不到解决问题的方法,所以希望大家能帮助我。 我尝试了很多天,在所有CSS后面都放了response.js,但它不起作用。
我的代码:
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<style>
.green{
background: #2DFF78;
}
.blue{
background: #02779E;
}
.col6{
margin-bottom: 20px;
}
</style>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="respond.min.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
在IE8上测试(通过使用IE9并在IE8上更改浏览器模式)
最近,我们已经使respond.js
与IE8兼容
它用于@media
查询 :
<style>
.green{ background: #2DFF78; }
.blue { background: #02779E; }
.col6 { margin-bottom: 20px; }
@media screen and (max-width: 600px) { .green { background: #ff0; }}
@media screen and (max-width: 450px) { .green { background: #f0f; }}
</style>
您需要在CSS中使用@media查询才能使其正常工作。 查看他们的示例以获取更多信息
我自己遇到了这个问题,结果证明该脚本的缩小版本在IE8中已损坏,您应使用未压缩的版本,并确保它不会在控制台上引发任何错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.