2010-08-27 84 views
3

當你使用jQuery具有不透明性校正CSS方法(線4592-4608上的jQuery 1.4.2):jQuery的CSS指南針般的修正

// 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的食譜)。

有沒有這樣的項目?

回答