[TYPO3] PNG fix for skin images
Peter Klein
peter at umloud.dk
Thu Jun 29 10:46:05 CEST 2006
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.
--
Peter Klein/Umloud Untd
"Tapio Markula" <tapio.markula at dnainternet.net> skrev i en meddelelse
news:mailman.1.1151520066.4912.typo3-english at lists.netfielders.de...
> Hi
>
> Skingreyman should have a PNG fix for MS in order to get transparency.
> Well, trying to use skingreyman PNG module icons vanished immediately
> (I saw them about one second).
>
> I tried to use the script in my skin skin_grey_2 in order to
> give possibility to use as alternative module icon set PNG images
> with transparency fix for MS IE.
>
> In fact I put the srcipt first to skin_grey_2 and wondered,
> where the PNG images vanished. But I found the same after uninstalling
> skin_grey_2 and installing skingreyman.
>
> The JavaScript doesn't seem to work as expected.
> Have you found the same thing. How to fix the JavaScript to get
> it work? Do someone know enough JavaScript.
More information about the TYPO3-english
mailing list