JS--------------图片放大缩小

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>童心少年</title>
      
  </head>
  <body>    
    
     <img id="im" onmouseout="da()" onmouseover="xiao()"> 
  <script>
        
          document.getElementById("im").src="https://miaobi-lite.bj.bcebos.com/miaobi/5mao/b%275Y2D6YeM5rGf5bGx5Zu%2BXzE3MzUzNDg5NzMuMDExNDYwNQ%3D%3D%27/0.png";
          document.getElementById("im").width=300;
          document.getElementById("im").height=300;
     function da(){
          document.getElementById("im").width=500;
         document.getElementById("im").height=500;
     }
     function xiao(){
         document.getElementById("im").width=300;
         document.getElementById("im").height=300;
     } 
    </script>  
  </body>
</html>

 

posted @ 2025-11-22 11:47  付书恒  阅读(3)  评论(0)    收藏  举报