pngfix Wordpress Plugin
This plugin uses CSS technique to fix the png image transparency issue and jQuery to apply this script to all of png images shown in the page. The CSS code added by the script is :
background-image: expression(
this.runtimeStyle.filter = “progid:DXImageTransform.Microsoft.AlphaImageLoader(src=” + (this.tagName==\‘IMG\’ ? this[\'src\'] : this.currentStyle[\'backgroundImage\'].split(\’\”\’)[1]) + ")",
this.runtimeStyle.backgroundImage = "none",
this.src = "{plugindir}/pixel.gif",
this.width = this.style.width | this.clientWidth,
this.height = this.style.height | this.clientHeight
);
}’;
And the jQuery code which applies this css to all of the png images :
if(($.browser.msie)&(parseInt($.browser.version)<7)){
$(“img[src$='.png']“).each(function(){$(this).addClass(“png”);});
}
});
That’s all. The jQuery library is included in the plugin so you don’t need to modify anything.
Installation is simple. Just follow these steps :
- Upload ‘wp-pngfix’ directory to the ‘/wp-content/plugins/’ directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Thats all. Go to any page which contains some png images with IE and check if there’s any errors.
This should fix them all except backgrounds now.
Download: Official WordPress plugin page : http://wordpress.org/extend/plugins/wp-pngfix/
Note: This type of fixes cause slight color changes to your png images with background color, so you may have to change some css.If you use images without inner backgrounds and only need to show the background transparent, forget that note
















31 Yorum Yapılmış, Yorum yapın yada Ping Bırakın
Thanks for the post and plugin
@giga: Thank you for using it
Shouldn’t we use a conditional comment here with the CSS ?? otherwise it will only overload browsers who don’t really need it
@krembo99: don’t worry, its using it. I didn’t mentioned over there. Bu in the code there is. I only wrote the CSS and the jQuery part of the script.
Well than, It looks like a great code (and lighter than others I have seen…)
)
Soon to be on my website I hope .
(Although I think the best solution would be to CONVINCE as much people as possiable to bandon IE
@krembo99: I think the best solution is to convince the web designers not to design IE only web sites. yesterday I was applying to a job over the net and their site just said me : “this only works with IE6+”
How can we leave using IE then?
hi. Thanks for plugin
perfect.
regards
Keep up the good work! 10q
Wordpress Plugins sitesinde malesef arama yapmama rağmen çıkmadınız. Onun yerine google ile ara seçeneğini seçtim ve ancak o zaman çıktı bilginize. Bunun yanında gerçekten başarılı. Beni bir ufak dertten kurtardınız . Artı olarak diğer js çözümlerinde malesef yorumlar kısmına eklemiş olduğum js kodları çalışmadı. Sizin ki çalıştı. Teşekkür ederim.
Birden böyle bir eklenti gördüğümü hatırlamıştım iyi ki de hatırlamışım..
http://wordpress.org/extend/plugins/search.php?q=png+fix
@eylultoprak: Wordpress’in arama motoru bi garip çalışıyor zaten. Neyse bulabildiğine sevindim. Ayrıca siten güzel olmuş. Kolay gelsin.
It don’t work for me
@Taha Paksu BBpress ‘in sorunları bitmek bilmiyor malesef. Bunu istersen bildirmen uygun bir davranış olur.
Teşekkür ederim sizinki de bir o kadar güzel
Fakat eklentiden vazgeçtim. ie6 ‘da site arasıra takılmaya başladı pngfix yapınca tabi bu kodlamay ile ilgili değil ie6′nın resmen aptallığı..
Neyse teşekkürler görüşürüz..
@eylultoprak: bbpress’i bildirmekle neyi kastettiğini anlamadım ya neyse. bende teşekkür ederim.
Don’t works with lightbox 2,0… any ideas?
@ponche: well that’s a interference problem with other javascript libraries. I’ll update the package with noconflict version.
Try the new version.
on wordpress downloads?
@Taha Paksu:
same problem with new release (2008-6-19).. the fix works perfect but lightbox only appears when I desactivate PNG fix.
… i need to fix a couple of images on only one page. it’s posible to select wich pages get the code?
@ponche: yes but you need to edit the code.
Well do it like this :
1) find the line starts with “echo” and delete below it. And then write “}?>” to the end. without the quotes.
2)then find the images you wish to fix and then;
a. if you know html, add ” class=’png’ ” inside the img tag.
b. if you are using the editor in your admin page, then open the image properties dialog about the image you want to fix, and then add the png word into the class field.
then it should work i think.
Nice plugin! What a shame I only found it now… I had so many troubles with PNG transparency due to IE6…
But I think there is something I can ask you (allthough it’s a little off-topic…)
What is your set of smilies? Where did you get it? Can you send me it or, at least, its URL?
Thanks in advance.
@José Luís: I found them here http://www.adiumxtras.com/index.php?a=search&cat_id=2 its named Simple Smilies as you can see on the list. And thanks.
thanks for the help taha paksu, but i can’t improve your plugin with the lightbox.. i give up and finally i put gif instead the pngs.
good luck with the plugin! works perfects except with lightbox!