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?

Recommended Answers

All 4 Replies

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...

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 + 

setImage( [arg1], [arg2] );

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

thanks wil give this a try

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.