Is there a cross browser way to change the opacity of an image? I have found a way that works for IE and Firefox but would like it to work in Safari and Opera as well.
Thanks.
| SitePoint Sponsor |


Is there a cross browser way to change the opacity of an image? I have found a way that works for IE and Firefox but would like it to work in Safari and Opera as well.
Thanks.


It's okay, I figured it out.
Thanks.
Code:function changeopacity( opacity, id ) { var object = document.getElementById( id ).style; object.opacity = ( opacity / 100 ); object.MozOpacity = ( opacity / 100 ); object.KhtmlOpacity = ( opacity / 100 ); object.filter = "alpha(opacity=" + opacity + ")"; }
Bookmarks