Skip to content

Instantly share code, notes, and snippets.

@paranoidjk
Created October 25, 2016 08:22
Show Gist options
  • Save paranoidjk/f2f07c9c127acedbe7fb171559913905 to your computer and use it in GitHub Desktop.
Save paranoidjk/f2f07c9c127acedbe7fb171559913905 to your computer and use it in GitHub Desktop.
opacity.md
.opacity{
    filter:alpha(opacity=50);       /* IE */
    -moz-opacity:0.5;              /* 老版Mozilla */
    khtml-opacity:0.5;              /* 老版Safari */
    opacity: 0.5;           /* 支持opacity的浏览器*/
}
object.filter = "alpha(opacity=" + opacity + ")";  /* IE */
object.MozOpacity = (opacity / 100);    /* 老版Mozilla */
object.KhtmlOpacity = (opacity / 100);    /* 老版Safari */
object.opacity = (opacity / 100);    /* 支持opacity的浏览器*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment