Results 1 to 2 of 2

Thread: Changing opacity levels in highlighting

  1. #1
    Join Date
    Aug 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Changing opacity levels in highlighting

    Forum-

    How would I change the opacity level to match the "on mouseover" and "onmouseout"? Before mouseover, the image appears lightened, but once you mouseout, you can barely see the image. How do I keep it consistent?

    Here are the images:
    http://romneypilates.com/massage2.htm


    And here is the code I used with some variation:
    <----head---->
    function makevisible(cur,which){
    strength=(which==0)? 1 : 0.2

    if (cur.style.MozOpacity)
    cur.style.MozOpacity=strength
    else if (cur.filters)
    cur.filters.alpha.opacity=strength*100
    }

    </script>

    <----img section---->
    style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)"



    Thanks for helping!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Use:

    HTML Code:
    style="filter:alpha(opacity=70);-moz-opacity:0.7"
    for the images and make the line in your script like so:

    Code:
    strength=(which==0)? 1 : 0.7
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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