Created
July 27, 2014 08:46
-
-
Save hehongwei44/87839cd3b8439aff6a3c to your computer and use it in GitHub Desktop.
调节元素透明度的函数
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*调节元素透明度的函数*/ | |
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