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
Post a Comment