...

View Full Version : -moz-opacity



premshree
08-20-2002, 08:03 AM
Is there a method to access the "-moz-opacity" style property in Mozilla?

martin_narg
08-20-2002, 11:09 AM
document.getElementById('myDiv').style.MozOpacity

Hope this helps

martin_narg

premshree
08-22-2002, 09:39 AM
No. That does not work.......

martin_narg
08-22-2002, 02:34 PM
Hope this helps, this script will only work for mozilla/NS6, but can easily be made cross-browser.

this is the script in the html/image zip file attached:



<html>
<head>
<script>
var count = .1;
var inc = true;
function doFade() {
count = (inc) ? count+.1 : count-.1;
if( count >= .9 )
inc = false;
if( count <= .1 )
inc = true;

document.getElementById("myImg").style.MozOpacity = count;

setTimeout("doFade()",200)
document.myForm.myText.value = "image opacity: "+document.getElementById("myImg").style.MozOpacity
}
</script>
</head>
<body onLoad="doFade()">
<img id="myImg" src="myImage.gif" width="50" height="50" style="-moz-opacity:.1"><br><br>
<form name="myForm">
<input type="text" name="myText">
</form>
</body>
</html>

premshree
08-25-2002, 08:04 PM
Thanks Martin.
I had set the -moz-opacity value to double-digits thinking that the max value was 100!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum