当您使用 css 方法时,jQuery 具有不透明度校正功能(jQuery 1.4.2 上的第 4592-4608 行):
// IE uses filters for opacity
if ( !jQuery.support.opacity && name === "opacity" ) {
if ( set ) {
// IE has trouble with opacity if it does not have layout
// Force it by setting the zoom level
style.zoom = 1;
// Set the alpha filter to set the opacity
var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
}
return style.filter && style.filter.indexOf("opacity=") >= 0 ?
(parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
"";
}
我已经开始扩展此行为,使 css 3 选择器与多浏览器兼容(使用 Compass framework implements 的很多方法)。
是否有元素已经这样做了?
最佳答案
有各种元素涵盖 CSS3 的不同方面。据我所知,没有像样的统一元素。
我目前正在使用: http://plugins.jquery.com/project/2d-transform
用于 CSS3 转换。我现在不太愿意推荐其他元素。
关于jquery css 类Compass修正,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3580746/