Finally, That Unit PNG Fix Update You’ve Been Clamoring For…
We know you have been teetering on the edge of your collective office chairs, anticipating the next iteration of the Unit PNG Fix. Well, the wait is finally over.
Only slightly larger than its predecessor, the new Unit PNG Fix weighs in at just over 1kb and now fixes your PNGs in IE6 before the page load, eliminating any pesky flickers as the script runs. Now, your beautiful PNGs can shine as they were intended, without betraying any of their unflattering incompatibilities.
Just one more thing (black turtleneck not included): You can now opt-in to fix only the PNGs you want fixed by adding a “unitPng” class to specific elements. By default, Unit PNG Fix will fix every PNG, but this may cause layout issues, or slow your page down with PNG-Fix-Overkill. Therefore, by adding the “unitPng” class, you can target only those PNGs that are acting up.
This is likely to be the last edit to the Unit PNG Fix (barring any major scripting errors). Muerte a IE6.
Comments (15)
Great work! I used the last version on my personal website and I love it. Is there any chance this version has CSS repeated .png background image support?
@Alex: No luck on the background-position. It is my thought this will just never happen, considering there is no viable option for making IE’s filter property recognize any sort of positioning. There are hacks that allow you to do this, but IMHO they compromise clean, semantic mark up for the sake of an anachronistic browser, which isn’t my idea of a good solution.
Didn’t work for me. Update got rid of the red ‘x’, so I know it’s trying. Do I need to DL the alphaimageloader somewhere? Then where do I put it on the server?
Well, excuse me. Works like a dream in tables, relative and absolute positioning and anywhere else on the page. My culprit was Irfanview 4.1 and 4.25 which didn’t save the images correctly every time. PhotoShop Elements did the trick for every graphic. Hint-Hint
Freddie
Anyone else have any issue using this with HTTPS? Not sure yet what the cause is, but after deploying this fix the sites throwing a non secure warning, and the path in unitpngfix.js to clear.gif is set correctly.
I’m having the same issue as above… getting a “This page contains both secure and nonsecure items.” message when using the PNG Fix on an HTTPS page. I get the same error if I have absolute links on my HTTPS pages but the only link in the script is a relative path to the clear.gif image.
Yeah I didn’t find the cause, I just abandoned it and went with the twin helix fix. Not as reliable thats for sure, lots of problem with the positioning of elements breaking the fix. I wish I could figure out what I need to do differently to use Unit’s… it worked great other than the warning popping up.
Works a treat. Thanks for that.
Found a solution for the HTTPS “nonsecure items” warning. Simply replace the document.write command with the following line:
document.write(”);
Woops.. my code got stripped.. should have seen that coming.
What ended up working for the secure / nonsecure issue? I’m still getting it.
Bob, I found the issue. Apparently the src cannot void or false, it has to point to a blank file
change: javascript:void(0)
to: src=”/scripts/blank.js”
yes, this requires an extra trip to the server to get blank.js, but at least it doesn’t throw errors
Not specifying width or height for tag is not working for me. don’t know from where, but it always gets 26x30px
And what is even more interesting – it works if I go to other page and then click back, but it doesn’t on refresh or first visit.
IE version: 6.02.2900.5512
Great tool . Does exactly what it says although I had no luck with it as it kept breaking my sliding door css menu . Shame as when I went to net renderer the png’s were indeed transparent but they menu was stretched full width . Removed the head script tag and yep , it all went back to normal .Static pics this works great , Sliding doors , unfortunately , no good for me :( .
Anyone have any ideas (besides making jagged gifs) on a fix for my sliding door menu buttons ? They look like utter s*$! in IE6 .
Wish it would just disappear , or maybe someone should lobby micro$oft to force an update on users lol ….. only in my dreams hahahaa
Was having trouble with IE6 nonsecure content warnings, and tracked it down to unitpngfix.
Anton’s fix works perfectly, create a new blank Javascript file and change the src attribute of the initial script element from javascript:void(0) to the path to your new blank JS file.
Cheers Unit folks for the png fix, and huge thanks to Anton for documenting the IE6 https tweak.
Your Comment