为什么我的只能放大一次
<body>
<div id="aa">
<img id="myimage" src="66.JPG"><br>
<input type="button" id="max" value="放大">
<input type="button" id="min" value="缩小">
</div>
<script>
window.onload=function(){
var maxtime=setInterval(function(){
var maxbut=document.getElementById("max");
maxbut.onclick=function(){
maxfun();
}
var img=document.getElementById("myimage");
var endwidth=img.width*1.03;
var endheight=img.height*1.03;
function maxfun(){
if(img.width<endwidth)
{
img.height=img.height*1.05;
img.width=img.width*1.05;
}
else{
clearInterval(maxtime);
}
},10);
}
}
</script>
</body>
</html>