glenelkins Posted April 22, 2007 Share Posted April 22, 2007 Hi Trying to set opacity on a link click, my javascript code is : function Dimm () { var divId='outer'; div=document.getElementById(divId);setOpacity(div,50); } It does not work!; Quote Link to comment Share on other sites More sharing options...
shaymol Posted April 22, 2007 Share Posted April 22, 2007 Hi mates You can try with the following method for setOpacity function setOpacity( element, alpha ) { var style = element.style; if( style.MozOpacity != undefined ) { //Moz and older style.MozOpacity = alpha; } else if( style.filter != undefined ) { //IE style.filter = "alpha(opacity=0)"; element.filters.alpha.opacity = ( alpha * 100 ); } else if( style.opacity != undefined ) { //Opera style.opacity = alpha; } } Thanks ShaymoL Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.