我有一张图片:
Clown%20Fish
onmouseover 我必须显示另一张图片:
image.jpeg
这是图像:
energy.jpeg
(显示 webkit-transition: opacity 1s ease-in-out 属性)
我在这里得到了第一个代码表单:http: //css3.bradshawenterprises.com/cfimg/#comments
剂量不起作用...
这是现场演示: http: //liveweave.com/6EgbYH
这是代码:
<!DOCTYPE html>
<html>
<head>
<style>
#cfnormal {
position:relative;
height:281px;
width:450px;
margin:0 auto;
}
#cf {
position:relative;
height:10px;
width:450px;
margin:0 auto;
}
#cf img {
position:absolute;
left:0;
width:450px;
-webkit-transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-o-transition: opacity 1s ease-in-out;
transition: opacity 1s ease-in-out;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
function change(x)
{
var element = document.getElementById('imgtop');
element.style.opacity = "0";
}
</script>
</head>
<body>
<div id="cf">
<img id="imgbott" class="bottom" src="./image.jpeg" />
<img id="imgtop" class="top" src="./energy.jpeg" />
</div>
<div id="cfnormal">
<img onmouseover="change(this)" src="./Clown%20Fish.jpg" />
</div>
</body>
</html>