Re: [OFF] - Transparency in DHTML layers?

From: Date: Tue, 08 Jun 2004 04:39:23 +0000
Subject: Re: [OFF] - Transparency in DHTML layers?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-187860@lists.php.net to get a copy of this message
On Monday 07 June 2004 02:51 pm, Marek Kilimajer wrote: > Brian Dunning wrote: > > Hi, > > > > Does anyone know if there is a spec that permits transparency of > > graphics in DHTML layers? I have a bottom layer which is a picture of > > fabric, and I have a grayscale image of wrinkles & shadows that I'd like > > to overlay on top of the fabric, with a certain level of transparency so > > the fabric is still visible in the shaded areas. > > > > Or, if anyone knows another technology that might accomplish that, I'd > > appreciate those suggestions too. :) > > > > Thanks, > > > > Brian Dunning > > http://www.briandunning.com/ > > Semitransparent PNGs, but that does not work in IE > > http://www.petitiononline.com/msiepng/petition.html I never got it quite perfect, but it shouldn't take too long. I just lost interest after about five minutes ;) function exploderPNGhack() { /* Internet Explorer PNG transparency hack * Evan Nemerson <evan@coeus-group.com> * * This should allow MSIE to properly display transparent PNGs. * * Thanks to: * http://www.alistapart.com/articles/pngopacity/ * http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html */ if ( /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32" ) { var imgs = document.getElementsByTagName("img"); var imgObjs = new Array(); for ( x = 0 ; x < imgs.length ; x++ ) { if ( /\.png$/i.test(imgs.item(x).src) ) { imgObjs[imgObjs.length] = imgs.item(x); var span = document.createElement("span"); span.mergeAttributes(imgs.item(x)); span.style.width = imgs.item(x).width; span.style.height = imgs.item(x).height; span.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imgs.item(x).src + "',sizingMethod='scale')"; imgs.item(x).parentNode.insertBefore(span, imgs.item(x)); } } } } -- Evan Nemerson evan@coeus-group.com http://coeusgroup.com/en -- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

« previous php.general (#187860) next »