reading image opacity

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dean Edwards

    reading image opacity


    I am attempting to change the opacity of an image. I can modify opacity ok:

    function flip(pic, opacity){
    pic.style.filte r = 'alpha(opacity= '+opacity+')';
    }


    But I'm not familiar with javascript. How can I read the existing opacity
    value?

    accessing the value like:

    opacity=cell.st yle.filter.alph a.opacity;

    does not work (in IE6).


    Also I am having trouble with the equivalent netscape syntax.

    Any help would be much appreciated.

    TIA

  • Vjekoslav Begovic

    #2
    Re: reading image opacity

    "Dean Edwards" <de@spamfree.co m> wrote in message
    news:AME9b.6256 $vX3.828808@war ds.force9.net.. .[color=blue]
    >
    > I am attempting to change the opacity of an image. I can modify opacity[/color]
    ok:[color=blue]
    >
    > function flip(pic, opacity){
    > pic.style.filte r = 'alpha(opacity= '+opacity+')';
    > }
    >
    >
    > But I'm not familiar with javascript. How can I read the existing opacity
    > value?
    >
    > accessing the value like:
    >
    > opacity=cell.st yle.filter.alph a.opacity;
    >
    > does not work (in IE6).[/color]

    If you have:

    <img id=sample src=sample.jpg style="filter:
    progid:DXImageT ransform.Micros oft.Alpha(opaci ty=50)">

    than you could do:

    sample.filters. item("DXImageTr ansform.Microso ft.Alpha").opac ity += 10;



    [color=blue]
    > Also I am having trouble with the equivalent netscape syntax.[/color]

    Filters are IE specific.

    HTH

    Vjekoslav


    Comment

    Working...