多个背景图像 IE8

Multiple background images IE8(多个背景图像 IE8)
本文介绍了多个背景图像 IE8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

是否有任何 jquery 插件(或任何其他方式)强制 IE8 显示多个背景图像?

Is there any jquery plugin (or any other way) to force IE8 to show multiple background images?

推荐答案

适用于 Internet Explorer 和旧版 Mozilla Firefox 的 CSS3 多背景

这个库通过从样式和链接标签中读取 CSS 代码,为 Internet Explorer 6-8 和 Firefox <=3.5 带来了对多个背景图像的支持.

This library brings support for multiple background images to Internet Explorer 6-8 and Firefox <=3.5 by reading the CSS code from style and link tags.

CSS3 浏览器支持扩展到背景图像、背景位置、背景重复.该库仅实现了自己的速记样式背景属性.

CSS3 browser support extends to background-image, background-position, background-repeat. This library only implements its own property for the shorthand style background property.

http://plugins.jquery.com/project/multiple-bg

示例用法

包括脚本

所有需要包含的只是 jQuery 库和此脚本,这些功能才能正常工作.不需要额外的 Javascript 编码.缩小后的库只有 8.7kB!

All that needs to be included is the jQuery library and this script for these features to work. No extra Javascript coding is required. The minified library is only 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

使用这个 Javascript 库读取使用 background 属性的多个背景.请注意如何支持悬停和活动状态.

Multiple backgrounds using the background property are read using this Javascript library. Notice how hover and active states are supported.

#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;
}

这篇关于多个背景图像 IE8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

append() 方法在被选元素的结尾(仍然在内部)插入指定内容。 语法: $(selector).append( content ) var creatPrintList = function(data){ var innerHtml = ""; for(var i =0;i data.length;i++){ innerHtml +="li class='contentLi'"; innerHtml +="a href
ExecJS::ProgramError: SyntaxError: Reserved word quot;functionquot;(ExecJS::ProgramError: SyntaxError: 保留字“function)
Infinite scroll and will_paginate appending the #39;next page#39; of items multiple times(无限滚动和 will_paginate 多次附加项目的“下一页)
What is cleanest way to turn Array of JQuery Promises into a JQuery Promise of an Array?(将 JQuery Promise 数组转换为数组的 JQuery Promise 的最简洁方法是什么?)
Scale background image to fit ie8 window(缩放背景图像以适合 ie8 窗口)
How to onclick-trigger a non-native jQuery plugin#39;s action?(如何点击触发非本地 jQuery 插件的操作?)