0

Hello, I have used the css background-size: cover, where it works well on Firefox and IE9, however, on IE8 it is not using this css at all, anyone can help me find a way to make it compatible on IE8 (and previous versions if possible) as well?

3
Contributors
4
Replies
16
Views
4 Years
Discussion Span
Last Post by Ritesh_4
0

thanks for these links
I however found can also use the IEFilters to do so:
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.myBackground.jpg', sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='myBackground.jpg', sizingMethod='scale')";

However in my case, I am loading my images dynamically from a php function in my html code, and would like to know how I can adapt this to the IEFilters...

0

Here you can try this function :

function setImage(targetElement, imageURL) {    
    if (typeof(targetElement)=="string") 
    { 
        targetElement = document.getElementById(targetElement);

        targetElement.style.filter = 
            "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + 
            imageURL + 
            "',sizingMethod='scale')";
    }
}

setImage( [arg1], [arg2] );

arg1 - a) image container element or b)its "id"; //format: a) object, or b) "string ";
arg2 - url\image ; //format: "sring" only;

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.