jquery - IE8 scale image to fit container with ms-filter -


i'm using following function append each div -ms-filter property scale background image fit container size in ie8:

    $('.news-product .product-image').each(function(){         var bg = $(this).css('background-image');         bg = bg.replace('url("','').replace('")','');          if(typeof bg !== 'none'){             $(this).css({                 "-ms-filter" : "progid:dximagetransform.microsoft.alphaimageloader(src='"+bg+"', sizingmethod='scale')"             });         }     }); 

it adds filter , sizingmethod not src attribute. if add manually works...

some suggestions?

hmm figured out. when adding "filter": "progid:dximagetransform.microsoft.alphaimageloader(src='"+bg+"', sizingmethod='scale')" works... strange! i've thought ie8 requires -ms-filter.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -