2012-08-06 35 views
0

是否有可能兩個:繪製邊框所有元素,但不捕獲事件

  • 畫的東西比其他元素在HTML
  • 不捕獲鼠標事件(點擊,懸停)

在IE8(其實,IE9 @ IE8模式)?也許,VML或一些棘手的行爲。

在其他瀏覽器中,我可以使用box-shadow,但是對於IE捕獲事件,都可以使用DropShadowBlur過濾器。有什麼選擇嗎?

我知道,我可以捕捉事件並重新啓動它們,但仍存在問題mouseover/mouseout

回答

0

看到這個答案:https://stackoverflow.com/a/11115375/638544

短版本:在IE中,與transparent背景顏色和應用不接收鼠標事件的梯度的元件。因此,添加到您的CSS:

.ie #overlay { 
    background: transparent; 
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#000000,endColorstr=#000000)"; /* IE8 */ 
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#000000,endColorstr=#000000); /* IE6 & 7 */ 
    zoom: 1; 
} 

(當然,你可以使用帶有background聲明針對IE的另一種方法,你可以改變顏色字符串值的任何你喜歡的。)