Skip to content

Instantly share code, notes, and snippets.

@hehongwei44
Created July 27, 2014 08:46
Show Gist options
  • Save hehongwei44/87839cd3b8439aff6a3c to your computer and use it in GitHub Desktop.
Save hehongwei44/87839cd3b8439aff6a3c to your computer and use it in GitHub Desktop.
调节元素透明度的函数
/*调节元素透明度的函数*/
function setOpacity(elem, level) {
//IE处理透明度
if (elem.filters) {
elem.style.filters = 'alpha(opacity=' + level + ')';
} else {
elem.style.opacity = level / 100;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment