鼠標懸停—戳眼睛=-=

戳眼睛·····

一個簡單的鼠標懸停事件
眼睛的圖片就忽略吧····
只附上代碼

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <script>

            //睜眼
            function openEye(){
                var eye = document.getElementById("eye");
                eye.src = "img/eye01.jpg";
            }

            //閉眼
            function closeEye(){
                var eye = document.getElementById("eye");
                eye.src = "img/eye02.jpg";
            }

        </script>
    </head>
    <body>

        <div onmouseover="closeEye()" onmouseout="openEye()" style="float: left;border: 1px solid #000000;">
            <img id="eye" src="img/eye01.jpg" width="200px" />
        </div>

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