Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: -moz-opacity

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Mumbai, India
    Posts
    218
    Thanks
    0
    Thanked 0 Times in 0 Posts

    -moz-opacity

    Is there a method to access the "-moz-opacity" style property in Mozilla?

  • #2
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    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

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Mumbai, India
    Posts
    218
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No. That does not work.......

  • #4
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    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 Attached Files
    "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

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Mumbai, India
    Posts
    218
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Martin.
    I had set the -moz-opacity value to double-digits thinking that the max value was 100!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •