Internet Explorer 8 - SCRIPT87:无效参数 - 大写字母

时间:2012-09-06 11:41:20

标签: javascript css internet-explorer google-maps

我有一个谷歌地图,我正在添加一些带有javascript代码的自定义按钮,然后将CSS样式应用于它们。 我的代码在Chrome,Firefox,IE9中显示正常,但在IE8中显示此错误:

SCRIPT87: Invalid argument 

应用css的javascript代码是:

var controlUI = document.createElement('div');

/* IE10 Consumer Preview */ 
controlUI.style.backgroundImage = '-ms-linear-gradient(top, #A4A4A4 0%, #6B6B6B 50%)';

/* Mozilla Firefox */ 
controlUI.style.backgroundImage = ' -moz-linear-gradient(top, #A4A4A4 0%, #6B6B6B 50%)';

/* Opera */ 
controlUI.style.backgroundImage = '-o-linear-gradient(top, #A4A4A4 0%, #6B6B6B 50%)';

/* Webkit (Safari/Chrome 10) */ 
controlUI.style.backgroundImage = ' -webkit-gradient(linear, left top, left bottom, color-stop(0, #A4A4A4 ), color-stop(0.5, #6B6B6B))';

/* Webkit (Chrome 11+) */ 
controlUI.style.backgroundImage = '-webkit-linear-gradient(top, #A4A4A4 0%, #6B6B6B 50%)';

/* W3C Markup, IE10 Release Preview */ 
controlUI.style.backgroundImage = 'linear-gradient(to bottom, #A4A4A4 0%, #6B6B6B 50%)';

controlUI.style.borderTop = '1px solid rgba(255, 255, 255, 0.8)';
controlUI.style.borderBottom = '1px solid rgba(0, 0, 0, 0.1)';
controlUI.style.borderRadius = '0 0 8px 8px';

1 个答案:

答案 0 :(得分:1)

IE8不接受使用rgba()颜色的alpha不透明度,你必须使用rgb();