PrateekSaxena Posted March 15, 2007 Share Posted March 15, 2007 I was this function in Scriptalicious, I want to know how I too can get and set the opacity of different DIVs through JS so it works in all browsers?EDIT : Delete this post! I found the method, this is the function I wrote : function setOpacity(id,opacity) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")";} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now