JS 鼠标移入移出改变图片大小
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<img src=" 图片地址" alt="" id="photo"
onclick="open()" onmouseout="small()" onmouseover="big()" />
</body>
<script type="text/javascript">
var p = document.getElementById("photo")
function small(){ // 鼠标移出事件,图片变小
p.setAttribute( "width" , "300px" )
p.setAttribute( "height", "300px" )
}
function big(){ // 鼠标经过事件,图片变大
p.setAttribute( "width" , "600px" )
p.setAttribute( "height", "600px" )
}
</script>
</html>
浙公网安备 33010602011771号