是否有任何jQuery插件(或任何其他方式)强制IE8显示多个背景图像?多个背景图像IE8
回答
CSS3多背景
这个库带来了多背景图片支持到Internet Explorer 6-8和Firefox < = 3.5,通过从样式和链接标签中读取CSS代码。
CSS3浏览器支持扩展到background-image,background-position,background-repeat。这个库只为速记风格的背景属性实现自己的属性。
http://plugins.jquery.com/project/multiple-bg
使用示例
包括脚本
所有需要被列入为jQuery库和这个脚本使用这些功能工作。无需额外的Javascript编码。缩小的库只有8.7kB!
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.multiple-bgs.js"></script>
编写CSS使用的background属性
多背景都采用这种Javascript库读取。注意如何支持悬停和活动状态。
#ex1 {
background: url(middle.gif) repeat-x 0 0; /* For unsupported browsers */
background: url(left.gif) no-repeat 0 0, /* For CSS3 Browsers */
url(right.gif) no-repeat 100% 0,
url(middle.gif) repeat-x 0 0;
}
#ex1:hover {
background: url(middle-hover.gif) repeat-x 0 0; /* For unsupported browsers */
background: url(left-hover.gif) no-repeat 0 0, /* For CSS3 Browsers */
url(right-hover.gif) no-repeat 100% 0,
url(middle-hover.gif) repeat-x 0 0;
}
#ex1:active {
background: url(middle-active.gif) repeat-x 0 0; /* For unsupported browsers */
background: url(left-active.gif) no-repeat 0 0, /* For CSS3 Browsers */
url(right-active.gif) no-repeat 100% 0,
url(middle-active.gif) repeat-x 0 0;
}
对于那些需要下载链接的人可以在这里找到:http://www.chicowebdesign.com/blog/2010/10/21/updated-jquery-multiple-background-plug-in/ – 2012-04-04 19:31:57
@Sonner我得到了跟随着误差在IE8“页面错误细节 信息:对象预期 行:7 字符:1 代码:0 URI:文件:jquery.multiple-bgs.min。JS 消息:预期的对象 行:13 字符:1 代码:0 URI:文件:jquery.multiple-bgs.js – 2012-05-16 12:10:46
@ eric.itzhak和Soner你能为我定义解决我的问题上述下面 – 2012-05-16 12:12:13
CSS3 PIE可以做你想找的Internet Explorer和传统的Mozilla Firefox CSS3 PIE
css3pie是一个神话般的小黑客,但我不知道它可以做CSS多个背景? – Spudley 2010-12-17 09:17:20
这不是我以前用过的东西,但是我打算很快。看看这里的文档http://css3pie.com/documentation/supported-css3-features/它可以使用-pie-background属性来完成。 – splatio 2010-12-17 18:24:04
这很好用。只是一个小问题,一定要在实际的IE8浏览器中测试 - 如果您尝试使用IE9的IE8模式,则-pie-background声明不会执行任何操作。 (至少在撰写本评论时) – 2011-04-25 18:57:19
如果不超过3张图片作为背景,你可以在CSS中:before
和:after
周围玩耍。例如,请参阅此link。
您可能需要添加在头下面但如果你想IE7的行为,以及:
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
- 1. IE8切断背景图像
- 2. 多个背景图像,附加图像
- 3. 从许多背景图像中创建一个背景图像
- 4. IE8中没有出现背景图像
- 5. 问题在IE8中的背景图像
- 6. CSS背景图像不显示IE8
- 7. 背景图像颜色变化ie8
- 8. 在IE8中消失的背景图像
- 9. 在IE8中的背景图像外观
- 10. IE8:边框+背景图像问题
- 11. IE8背景图像不显示
- 12. IE7/IE8非背景图像闪烁
- 13. PNG-24背景图像模糊在IE8
- 14. 边框半径,背景图像,背景渐变和IE8,IE10
- 15. 如何使用多个背景图像指定单个全局背景图像?
- 16. CSS多图像背景行?
- 17. 在背景图像背景图像
- 18. 定位多个背景图像
- 19. 框架的多个背景图像
- 20. CSS3中的多个背景图像
- 21. 多个背景图像更改为
- 22. 多个背景图像的内容div
- 23. 获取多个图像作为背景
- 24. 转换多个背景图像
- 25. 多个背景图像放置
- 26. 使用CSS3的多个背景图像
- 27. 动画与多个背景图像
- 28. 网页身体背景多个图像
- 29. 多个背景图像定位
- 30. 在背景上使用多个图像
@mu太短了 - 我不知道该说些什么。因为我想拥有多个背景的原因是非常大而广泛的,我不明白这将如何帮助回答我的问题。 – Diego 2010-12-17 11:19:08