The problem that IE has while making the PNG transparent using filter CSS can be solved by using the Sleight.js but this script doesn't seems to be work for the background images (I mean, if the PNG images are loading as "background-image" style tag)
Basically, the Sleight.js works like as follows,
- Make the all images (img, input:image) int the document invisible
- Loop thru each and every PNG files
- Apply the filter option to the PNG file thru an Image object
- Make the all images (img, input:image) int the document visible
But, in the step 2 while it loops thru all the images, it cannot find the background images present in the document since document.images.length only gives the images that are presently visible and
as well.
And, the way the images are loaded with transparency is with the below code,
function fnFixPng(img) {
var src = img.src;
img.style.width = img.width + "px";
img.style.height = img.height + "px";
img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
src + "', sizingMethod='image')"
img.src = "images/x.gif";
}
And, the script that calls this method to process the images is,
for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--) {
if (itsAllGood && img.src.match(/\.png$/i) != null) {
fnFixPng(img);
/// Other code //
So, Iam wondering how to find the background images present in the html page and process the PNG transparency.
Let me know if you something to say!!