I am trying to work around with the background size property in IE 7
and IE 8
. I know they don't support it and I am trying to use AlphaImageLoader
for my solution. I want to change the image source dynamically in javascript
but I am not sure how. Here are my codes.
var div = document.createElement('div');
var imgSrc ='/images/' + image;
div.className = 'div_element';
div.style.width = '112px';
div.style.height = '100px';
div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=imgSrc, sizingMethod='scale')";
The whole codes don't work. There is no images shown in IE. Are there anyways to do this? Thanks a lot!