I placed the following code in the window.onload method. It works but only on inline images. It will not work if the image is loaded through css. For the transparent PNG's I use Fireworks 8 and export as PNG 32.<br><br>Also, I did not write this code. I got it off of some website. I forget which and I will link to it if I can find it.
<br><br>/*************** Transparent PNG **************************/<br>var arVersion = navigator.appVersion.split("MSIE")<br> var version = parseFloat(arVersion[1])<br> <br> //transperent png support
<br> if ((version >= 5.5) && (document.body.filters)) <br> {<br> for(var i=0; i<document.images.length; i++)<br> {<br> var img = document.images
[i]<br> var imgName = img.src.toUpperCase()<br> if (imgName.substring(imgName.length-3, imgName.length) == "PNG")<br> {<br> var imgID = (<a href="http://img.id">
img.id</a>) ? "id='" + <a href="http://img.id">img.id</a> + "' " : ""<br> var imgClass = (img.className) ? "class='" + img.className + "' " : ""
<br> var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "<br> var imgStyle = "display:inline-block;" +
img.style.cssText <br> if (img.align == "left") imgStyle = "float:left;" + imgStyle<br> if (img.align == "right") imgStyle = "float:right;" + imgStyle
<br> if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle<br> var strNewHTML = "<span " + imgID + imgClass + imgTitle<br> + " style=\"" + "width:" +
img.width + "px; height:" + img.height + "px;" + imgStyle + ";"<br> + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"<br> + "(src=\'" +
img.src + "\', sizingMethod='scale');\"></span>" <br> img.outerHTML = strNewHTML<br> i = i-1<br> }<br> }<br> }<br><br>
<div><span class="gmail_quote">On 6/19/06, <b class="gmail_sendername">Nicolas Terray</b> <<a href="mailto:nicolas.terray@gmail.com">nicolas.terray@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've used /IE7/ in the past to work with transparency. However it is<br>not the prototype way.<br><a href="http://dean.edwards.name/IE7/">http://dean.edwards.name/IE7/</a><br><br>On 6/19/06, Sam <<a href="mailto:sam.google@iness.com">
sam.google@iness.com</a>> wrote:<br>><br>><br>> Is there a prototype / extension which will assist in cross-browser support<br>> of PNG images?<br>><br>> <a href="http://www.alistapart.com/articles/pngopacity/">
http://www.alistapart.com/articles/pngopacity/</a><br>><br>> It seems to me that a class could be developed which would zip through the<br>> DOM and make changes where needed for IE 5.5 / IE 6.0 to handle PNG images.
<br>><br>> I don't want to write one if it's been done before.<br>><br>> Sam<br>><br>><br>> _______________________________________________<br>> Rails-spinoffs mailing list<br>> <a href="mailto:Rails-spinoffs@lists.rubyonrails.org">
Rails-spinoffs@lists.rubyonrails.org</a><br>> <a href="http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs">http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs</a><br>><br>><br>><br>_______________________________________________
<br>Rails-spinoffs mailing list<br><a href="mailto:Rails-spinoffs@lists.rubyonrails.org">Rails-spinoffs@lists.rubyonrails.org</a><br><a href="http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs">http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
</a><br></blockquote></div><br>