Javascript IE8背景大小不工作
我正在努力填补我的形象适合的DIV大小。 我已经发现“背景大小:包含”不适用于Internet Explorer 8 对于我的特定代码是否有可能的解决方法Javascript IE8背景大小不工作,javascript,html,css,background,internet-explorer-8,Javascript,Html,Css,Background,Internet Explorer 8,我正在努力填补我的形象适合的DIV大小。 我已经发现“背景大小:包含”不适用于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;
.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')');
由于这两个位,您会得到一个
意外的标识符
:
',sizingMethod='scale')');
你必须把它改成
',sizingMethod=\'scale\')');
或
IE8不支持它。可能重复我已更新我的javascript源代码。使用此代码,我得到一个“意外标识符”
',sizingMethod="scale")');