遇到一個似乎只是IE問題的問題,我不知道如何解決它。我知道很多人這樣做,但我不知道如何使它與IE正常工作。兒童圖像不允許頂層更改onmouseover
我正在研究一個電子商務網站,我們希望在產品圖像上方懸停時覆蓋產品圖像頂部的某個產品的某些詳細信息。包含的DIV是JavaScript觸發器,但如果鼠標在擊中div之前擊中了圖像,div類更改將不會執行。
如果你去的jsfiddle,如果從右側或DIV的左側開始盤旋,它完美的作品。如果從底部或頂部開始,圖像展開到哪裏,則不會。
<div class="product">
<div class="product_activitylayer" align="right" onmouseout="this.className='';this.className='product_activitylayer'" onmouseover="this.className='';this.className='product_activitylayer_hover'">
</div>
<div class="product_containertop" align="center">
<img src="images/demoimages/product.jpg" height="160">
</div>
</div>
.product {
width:244px;
height:221px;
display:block;
float:left;
margin:0px 3px 5px 0px;
border-top:solid;
border-top-color:#10B0E5;
border-top-width:6px;
}
.product_containertop {
height:160px;
width:244px;
background:#FFFFFF;
border-bottom:solid;
border-bottom-width:1px;
border-bottom-color:#C7EEFA;
margin-bottom:2px;
}
.product_activitylayer {
height:160px;
width:244px;
position:absolute;
z-index:999;
}
.product_activitylayer_hover {
height:160px;
width:244px;
position:absolute;
z-index:999;
background:#00CCFF;
opacity:.5;
filter:alpha(opacity="50");
}
一個改進版本更新:不透明度在層不能被視爲0,我需要查看在該層的對象(我剛開始移除他們爲了容易解釋,認爲這些對象與解決方案無關。這裏是更新的jsfiddle ... jsfiddle.net/NETJ4/2 –