Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthoraconnor
    • CommentTimeFeb 1st 2006 edited
     permalink
    Can someone point me to a standards compliant method for altering the opacity of an image when moused over?
    • CommentAuthormatthewv
    • CommentTimeFeb 1st 2006
     permalink
    you can do it with javascript

    http://www.alistapart.com/articles/pngopacity/
    or
    http://www.codeproject.com/jscript/opacity.asp

    The first is the best way to go about it, and its cross-browser compatible
    • CommentAuthoraconnor
    • CommentTimeFeb 2nd 2006
     permalink
    Ok, but what if I'm working with JPGs? The images I'm using are being fed from Flickr.
    • CommentAuthormatthewv
    • CommentTimeFeb 2nd 2006 edited
     permalink
    Well the javascript loads a local file so you would have to use non-standards-compliant code to filter your flickr feed

    You can do this.. dont know if it works for FF or IE5

    <img style="filter:alpha(opacity=50)" onMouseOut="this.filters.alpha.opacity="50"" onMouseOver="this.filters.alpha.opacity="100"" src="image.jpg" />
  1.  permalink
    the filter property is a IE proprietary thing.

    Put it in conditional comments for IE (<!--[if lt IE 7]><style type="text/css">a img { insert-ie-filter-thing-here: value; }</style><![endif]-->)

    For the rest of the browsers, use the CSS3 specification/-moz- prefix since it already works in Safari, Opera 9 and FF1.7.

    It should soon be coming in iCab, KHTML and Tasman rendering engines.


    Of course, javascript works too, if it's truly important.
    • CommentAuthoraconnor
    • CommentTimeFeb 3rd 2006
     permalink
    Thanks. I'll give it a shot.
Add your comments
    Username Password
  • Format comments as (Help)