- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 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"});
});
最佳答案
IE8 不支持 CSS background-size
。
您链接的页面是一个 jQuery hack,尝试在旧版浏览器中实现它;如果它不适合您,则意味着您没有正确加载插件。
您还可以考虑使用替代选项:CSS3Pie库将对 CSS background-size
的支持实现到旧的 IE 版本中,并且使用 CSS3Pie 您可以将它直接放入您的 CSS 代码中,就像您通常对其他浏览器所做的那样。
关于jquery.backgroundSize.js 不工作ie8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19399386/
我想在 JavaScript 中更改背景图像的大小,但没有成功。 Console.log 显示“无法设置未定义的属性‘backgroundSize’”。我的代码是 document.getElemen
我正在使用 jquery.backgroundSize.js插件,但我不能让它在 IE8 中工作。 我从官方网站下载,然后我玩了试玩版,但没有任何反应。我制作了一个测试页面,它在 IE9、Firefo
我正在使用以下代码来调整名为 remote 的元素的背景大小: document.getElementById('remote').style.backgroundSize = '80% 100%';
这个问题在这里已经有了答案: Why doesn't -moz-background-size:cover work in Firefox? (1 个回答) 关闭 8 年前。
我正在使用 css 动画制作动画背景。我可以在单击按钮时将其关闭,但它不适用于第二次单击。我知道这是可能的,因为我在控制台中输入了该函数并且它起作用了。 我已经尝试过 switch 语句和条件语句。
我在移动网络应用程序中工作,某些不支持 css3 和@media 查询的设备存在问题, 我得到 [css3-mediaqueries.js] 让所有浏览器都支持媒体查询,但我现在的问题是我需要检查不支
有没有办法找到元素中背景图像的绝对背景大小。 CSS3 属性可以返回自动/百分比等形式的值。但是我想找出绝对值(比如 200 像素、100 像素) 我知道一种方法,我们可以在隐藏的 img 元素中使用
我是一名优秀的程序员,十分优秀!