鼠標移入之張嘴、閉眼

鼠標移入圖片位置時張開嘴巴:

<!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>
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章