Try this:
<!DOCTYPE html>
<html>
<head>
<script src="/assets/js/jquery-1.10.2.min.js"></script>
</head>
<body>
<style>
#testarea1, #testarea2 {
position:absolute;
background-color: #666;
width: 200px;
height: 200px;
}
#testarea2 {
display: none;
}
</style>
<script>
$(document).ready(function(){
$("#testarea1").mouseover(function(){
$("#testarea2").css("background-color","yellow");
$("#testarea1").fadeOut(500);
$("#testarea2").fadeIn(1500);
});
$("#testarea2").mouseout(function(){
$("#testarea1").css("background-color","#666");
$("#testarea2").fadeOut(500);
$("#testarea1").fadeIn(1500);
});
});
</script>
<p>Hover to see effect</p>
<div id="testarea1">displayarea1</div>
<div id="testarea2">displayarea2</div>
</body>
</html>
我不認爲這可以做到。如果你正在使用矢量或其他的東西,但是如果你不能在上面加任何東西來使它變暗,我就不會看到它。我會很感興趣,看看有人能想出一些東西。唯一能想到的就是創建一個黑色版本的圖像,置於頂部,使用不透明度。 – Leeish 2013-03-14 03:08:03