Mencarta Posted November 25, 2010 Share Posted November 25, 2010 java script: function changeOpacity(var opacity){ // CSS3 document.getElementById("gallery-pic").style.opacity = opacity / 100; // IE document.getElementById("gallery-pic").style.filter = "alpha(opacity=" + opacity + ")";} For some strange reason this code won't work. Nothing is wrong with it as far as I can tell. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
dsonesuk Posted November 25, 2010 Share Posted November 25, 2010 remove variable declaration var from functionfunction changeOpacity(opacity) Link to comment Share on other sites More sharing options...
Mencarta Posted November 25, 2010 Author Share Posted November 25, 2010 Thank you. Link to comment Share on other sites More sharing options...
ApocalypeX Posted November 25, 2010 Share Posted November 25, 2010 I wish Javascript let you set defaults values for variables in the arguments declaration instead of inside the function Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.