开发者

Jquery css Compass-like correction

jQuery has opacity correction when you use css method (lines 4592-4608 on jQuery 1.4.2):

    // 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 z开发者_高级运维oom 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) + "":
            "";
    }

I've started extending this behaviour to turn css 3 selectors multi browser compatible (using a lot of recipes that the Compass framework implements).

Is there a project that already does this?


There are various projects that cover different aspects of CSS3. AFAIK there's no decent unified project.

I'm currently using: http://plugins.jquery.com/project/2d-transform

for CSS3 transforms. I can't really feel comfortable recommending other projects at this time.

There's also: http://plugins.jquery.com/project/corners

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜