[TYPO3] PNG fix for skin images

Peter Klein peter at umloud.dk
Thu Jun 29 12:43:28 CEST 2006


The script I posted works perfectly in IE.. (It only works in IE)

-- 
Peter Klein/Umloud Untd


"Tapio Markula" <tapio.markula at dnainternet.net> skrev i en meddelelse 
news:mailman.1.1151572708.8074.typo3-english at lists.netfielders.de...
> 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