IE8背景大小不起作用

时间:2015-02-17 17:11:20

标签: javascript html css background internet-explorer-8

我正在尝试填充我的图像符合DIV的大小。 我已经发现“background-size:contains”对Internet Explorer 8不起作用。

我的特定代码是否有可能的解决方法。

    .thumb {
        /* Select a maximum height and width to allot for each thumbnail. Set margin size here as well. */
        height: 125px;
        width: 135px;
        /* Do not edit these properties. */
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
    }

在我的javascript中:

            $('.thumb:' + place).css("background-image", 'url(' + entry.thumbnailURL + ')');
            $('.thumb:' + place).css("filter", 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + entry.thumbnailURL + ',sizingMethod='scale')');
            $('.thumb:' + place).css("-ms-filter", 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + entry.thumbnailURL + ',sizingMethod='scale')');

1 个答案:

答案 0 :(得分:0)

由于这两位,你得到Unexpected identifier

 ',sizingMethod='scale')');

您必须将其更改为

',sizingMethod=\'scale\')');

',sizingMethod="scale")');
相关问题