我在Opera瀏覽器中懸停有一個奇怪的問題。 這裏的測試用例:如何強制Opera的懸停觸發
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>opera hover issues</title>
</head>
<style>
.item {
background-color:pink;
border:1px solid red;
color: maroon;
height:100px;
width:300px;
}
.item a {
display:none;
}
.item:hover a{
display:block;
}
.item a:hover {
font-weight:bold;
background-color: yellow;
}
</style>
<body>
<div class="item">
an item - 0
<a href="javascript:void(0)">remove</a>
</div>
<div class="item">
an item - 1
<a href="javascript:void(0)">remove</a>
</div>
<div class="item">
an item - 2
<a href="javascript:void(0)">remove</a>
</div>
</body>
<script>
document.onclick = function(evt) {
var el = evt.target;
if (el.nodeName == 'A') {
var to_remove = el.parentNode;
to_remove.parentNode.removeChild(to_remove);
}
}
</script>
嘗試點擊第一項的「刪除」鏈接 正如你將能夠看到,在Opera(至少在Opera 9.61)сss定義懸停不觸發,直到鼠標移動。
有沒有人試圖解決這個問題?
在此先感謝!