[TYPO3] PNG fix for skin images

Tapio Markula tapio.markula at dnainternet.net
Thu Jun 29 11:12:14 CEST 2006


Peter Klein wrote:
> Hi Tapio. I don't use skins, but you can do something like this in 
> Javascript:
> 
> -- cut --
>  <script>
>  // Init function
> function init() {
>  if (!document.all) return;
>  var imgs = document.getElementsByTagName('img');
>  for (z = 0; z < imgs.length; z++) {
>   src = imgs[z].src;
>   if (src.substring(src.lastIndexOf('.')+1) == 'png') {
>    imgs[z].src = 'clear.gif';
>    imgs[z].style.filter = 
> "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', 
> sizingMethod='scale')";
>   }
>  }
> }
>  window.onload = init
>  </script>
> -- cut --
> 
> Once the page is loaded, the script replaces the SRC attribute with 
> "clear.gif" on all IMG tags (which uses PNG files), and instead add a CSS 
> "filter" to display the image.

Well the replacement works but after that images vanished.
I expect that this should work this way:

1) rendered PNG without transparency

2) replaced src with clear.gif

3) get back original images with transparency using 'filter' property

The step '3)' failed.

The filter property doesn't get original images to render them.



More information about the TYPO3-english mailing list