IE8 中的填充、不透明度、strokeColor 和 strokeWidth
Fill, opacity, strokeColor and strokeWidth in IE8
我已经动态添加了一个CSS class如下:
var style = document.createElement('style');
style.id = "highlightSegment";
var text = ".highlightStyle { fill:" + fill + ";opacity:" + opacity + ";stroke:" + strokeColor + ";stroke-width:" + strokeWidth + "+ }";
style.setAttribute("type", "text/css");
if (style.styleSheet) { // for IE
style.styleSheet.cssText = text;
} else { // others
var textnode = document.createTextNode(text);
style.appendChild(textnode);
}
var h = document.getElementsByTagName('head')[0];
h.appendChild(style);
在css是,
var text = ".highlightStyle { fill:" + fill + ";opacity:" + opacity + ";stroke:" + strokeColor + ";stroke-width:" + strokeWidth + "+ }";
fill
、opacity
、strokeColor
和strokeWidth
是动态变化的变量。这些属性在除 IE8 之外的所有浏览器中都可以正常工作。
我该如何解决这个问题?
您可能想查看 How to Simulate CSS3 box-shadow in IE6-8 Without JavaScript.。
我还没有测试过,但值得一试。
filter: progid:DXImageTransform.Microsoft.Shadow(Color=#cccccc, Strength=5, Direction=0),
progid:DXImageTransform.Microsoft.Shadow(Color=#cccccc, Strength=5, Direction=90),
progid:DXImageTransform.Microsoft.Shadow(Color=#cccccc, Strength=5, Direction=180),
progid:DXImageTransform.Microsoft.Shadow(Color=#cccccc, Strength=5, Direction=270);
编辑:
我并不是建议在 Shadow 上停下来,而是要深入探讨 DXImageTransform.Microsoft class,Static Filters 对此进行了详细阐述。这仅适用于 IE5.5 到 IE8。
我已经动态添加了一个CSS class如下:
var style = document.createElement('style');
style.id = "highlightSegment";
var text = ".highlightStyle { fill:" + fill + ";opacity:" + opacity + ";stroke:" + strokeColor + ";stroke-width:" + strokeWidth + "+ }";
style.setAttribute("type", "text/css");
if (style.styleSheet) { // for IE
style.styleSheet.cssText = text;
} else { // others
var textnode = document.createTextNode(text);
style.appendChild(textnode);
}
var h = document.getElementsByTagName('head')[0];
h.appendChild(style);
在css是,
var text = ".highlightStyle { fill:" + fill + ";opacity:" + opacity + ";stroke:" + strokeColor + ";stroke-width:" + strokeWidth + "+ }";
fill
、opacity
、strokeColor
和strokeWidth
是动态变化的变量。这些属性在除 IE8 之外的所有浏览器中都可以正常工作。
我该如何解决这个问题?
您可能想查看 How to Simulate CSS3 box-shadow in IE6-8 Without JavaScript.。
我还没有测试过,但值得一试。
filter: progid:DXImageTransform.Microsoft.Shadow(Color=#cccccc, Strength=5, Direction=0),
progid:DXImageTransform.Microsoft.Shadow(Color=#cccccc, Strength=5, Direction=90),
progid:DXImageTransform.Microsoft.Shadow(Color=#cccccc, Strength=5, Direction=180),
progid:DXImageTransform.Microsoft.Shadow(Color=#cccccc, Strength=5, Direction=270);
编辑:
我并不是建议在 Shadow 上停下来,而是要深入探讨 DXImageTransform.Microsoft class,Static Filters 对此进行了详细阐述。这仅适用于 IE5.5 到 IE8。