鼠标移入之张嘴、闭眼

来源:互联网 发布:鬼才电影 知乎 编辑:程序博客网 时间:2024/04/28 00:41

鼠标移入图片位置时张开嘴巴:

<!DOCTYPE html>
<html>
<head>
<metacharset="UTF-8">
<title></title>
<script>
function closeEye(){
var eye = document.getElementById("eye");
eye.src = "img/77.png";
}
function openEye(){
var eye = document.getElementById("eye");
eye.src = "img/88.png";
}
</script>
</head>
<body>
<divonmouseover="closeEye()"onmouseout="openEye()"style="width: 200px;">
<imgid="eye"src="img/77.png" />
</div>
</body>
</html> 

鼠标移入图片时闭眼:

<!DOCTYPE html>
<html>
<head>
<metacharset="UTF-8">
<title></title>
<script>
function closeEye(){
var eye = document.getElementById("eye");
eye.src = "img/66.png";
}
function openEye(){
var eye = document.getElementById("eye");
eye.src = "img/55.png";
}
</script>
</head>
<body>
<divonmouseover="closeEye()"onmouseout="openEye()"style="width: 200px;">
<imgid="eye"src="img/55.png" />
</div>
</body>
</html> 

原创粉丝点击