Version: 1.0, by Oblivion Knight
Developer Last Online: Nov 2016
Version: 3.5.5
Rating:
Released: 08-15-2005
Last Update: Never
Installs: 198
Template Edits
Additional Files
No support by the author.
Ever wanted to allow your users to see transparent PNG images using Internet Explorer? Now you can!
[high]Note:[/high]I did NOT create this script, it remains the sole property of it's author.
Pros & Cons
Pros:
Ignored as a comment in other browsers, so no browser-sniffing code is required
Works with (X)HTML Strict & Transitional Doctypes
Does not break W3C validation
Lightweight and very easily deployed
Works with existing in-line or external CSS rules based on class or ID selectors
Works with old-style img align="left" or align="right" attributes
Adds itself to the end of any existing Body Onload code
Works with imagemaps and input images using a special version
Cons:
Doesn't work in IE versions earlier than 5.5
Requires JavaScript to be enabled - the estimations for how many people choose not to use JS vary wildly.
CSS backround PNGs not supported - experimentation revealed I could traverse the Stylesheets collection and use the AlphaImageLoader trick to replace all background-image attributes containing PNGs, but then background-repeat would not work, and anchors placed over non-transparent parts of the image were not clickable :-(
CSS rules for the PNG images based on the img selector are lost, but this is easily rectified by adding a class selector to your img rule such that img{..} becomes img,.png{..} - then add the attribute class="png" to each of your PNGs.
To install, simply upload the attached .js file to your /forums/clientscript/ directory.
Then edit your headinclude template, and add the following:
You're all set.! Note: Updated to reflect changes by the author, and 3.5.x javascript handling changes. This template modification works fine with 3.6.x as it is, and therefore won't be posted in the 3.6.x forum!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Hi - wondering if this could be made to work with a "runtime generated" png? We've just installed LaTex onto our forum and we output that as a transparent PNG, which looks fine on all browsers bar IE of course.
This hack works perfectly for me except for one major problem: Avatars.
I thought the problem was that height and width weren't specified, but I spent two hours trying to figure out how to add that and it still wouldn't work. Anyone?
This hack works perfectly for me except for one major problem: Avatars.
I thought the problem was that height and width weren't specified, but I spent two hours trying to figure out how to add that and it still wouldn't work. Anyone?
Avatars should work if you use the file system storage option instead of database..