2012-09-06 41 views
0

我有一個谷歌地圖,我用JavaScript代碼添加一些自定義按鈕,然後將CSS樣式應用於它們。 我的代碼顯示細膩的Chrome,火狐,IE9但IE8會顯示此錯誤:Internet Explorer 8 - SCRIPT87:無效參數 - 大寫字母

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

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