我正在使用jquery.backgroundSize.js插件,但我不能让它在 IE8 中工作。
我从官方网站下载,然后我玩了演示,没有任何反应。我制作了一个测试页面,它在 IE9、Firefox 等中运行良好,但在 IE8 中没有。
CSS:
#main{
background:url('parthenon.jpg') no-repeat;
margin:20px;
height:200px;
width:200px;
border:1px solid;
}
html:
<div id="main">
background
</div>
js:
$(function() {
$("#main").css({backgroundSize: "contain"});
});