Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-20-2002, 07:03 AM   PM User | #1
premshree
Regular Coder

 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
premshree is an unknown quantity at this point
-moz-opacity

Is there a method to access the "-moz-opacity" style property in Mozilla?
premshree is offline   Reply With Quote
Old 08-20-2002, 10:09 AM   PM User | #2
martin_narg
Regular Coder

 
martin_narg's Avatar
 
Join Date: Jul 2002
Location: Chamonix, France
Posts: 600
Thanks: 1
Thanked 3 Times in 3 Posts
martin_narg is an unknown quantity at this point
document.getElementById('myDiv').style.MozOpacity

Hope this helps

martin_narg
__________________
"Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
-Tommy Cooper
martin_narg is offline   Reply With Quote
Old 08-22-2002, 08:39 AM   PM User | #3
premshree
Regular Coder

 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
premshree is an unknown quantity at this point
No. That does not work.......
premshree is offline   Reply With Quote
Old 08-22-2002, 01:34 PM   PM User | #4
martin_narg
Regular Coder

 
martin_narg's Avatar
 
Join Date: Jul 2002
Location: Chamonix, France
Posts: 600
Thanks: 1
Thanked 3 Times in 3 Posts
martin_narg is an unknown quantity at this point
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:

Code:
<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>
Attached Files
File Type: zip mozopacity.zip (671 Bytes, 122 views)
__________________
"Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
-Tommy Cooper
martin_narg is offline   Reply With Quote
Old 08-25-2002, 07:04 PM   PM User | #5
premshree
Regular Coder

 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
premshree is an unknown quantity at this point
Thanks Martin.
I had set the -moz-opacity value to double-digits thinking that the max value was 100!
premshree is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:42 AM.


Advertisement
Log in to turn off these ads.