weixin_44887898
weixin_44887898
2019-04-08 12:15

js事件mouseover和mouseout没效果 chorme浏览器

  • node.js
  • html5
  • vue.js
  • javascript
  • jquery
<!DOCTYPE html>`
<html>
    <head>
        <meta charset="utf-8">
        <script>
            function lightOn(){
                document.getElementById("con").src="http://image108.360doc.com/DownloadImg/2017/07/3109/107140758_2.png";
            }
            function lightOff(){
                document.getElementById("con").src="http://image108.360doc.com/DownloadImg/2017/07/3109/107140758_3.gif";
            }
        </script>

    </head>
    <body>
        <h1>控制灯泡开关</h1>
        <img src="http://image108.360doc.com/DownloadImg/2017/07/3109/107140758_2.png" id="con" onmouseover="lightOn()" onmouseout="lightOff()"
        width="100px" height="180px">              
    </body>
</html>
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答

为你推荐