Js滑鼠放上去圖片變大變小

Lily_小麗麗發表於2018-02-08
<img src="" onmouseover="bigger()" onmouseout="smaller()" id="img">
<script type="text/javascript">
 var img = document.getElementById('img');
 //alert(img);
 function bigger(){
  img.style.width = '400px';
  img.style.height = '400px';
 }
 
 function smaller(){
  img.style.width = '100px';
  img.style.height = '100px';
 }
</script>

相關文章