Skip to content

Instantly share code, notes, and snippets.

@hehongwei44
Created July 27, 2014 08:46
调节元素透明度的函数
/*调节元素透明度的函数*/
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