[TYPO3] PNG fix for skin images
Tapio Markula
tapio.markula at dnainternet.net
Thu Jun 29 11:50:59 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.
>
Does that need ActiveX control or what could be the reason, that
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')";
fails?
If so, PNG transparency fix must set as conditional
using enable options.
Or is there some JavaScript for that task?
More information about the TYPO3-english
mailing list