展开全部
<html>
<head>
<title>图片放大</title>
<script type="text/javascript">
function zoomIn(){
//此处点击图片时会将图片放大到原来的三倍大小,重复点击一直放大
var imgNode = document.getElementById("image");
var width = imgNode.width;
var height = imgNode.height;
var width_tmp = width*3;
var height_tmp = height*3;
imgNode.style.width = width_tmp+"px";
imgNode.style.height = height_tmp+"px";
}
</script>
</head>
<body>
<img src="image/1.jpg" id="image" onclick="zoomIn()"/>
</body>
</html>
希望可以帮到你
<head>
<title>图片放大</title>
<script type="text/javascript">
function zoomIn(){
//此处点击图片时会将图片放大到原来的三倍大小,重复点击一直放大
var imgNode = document.getElementById("image");
var width = imgNode.width;
var height = imgNode.height;
var width_tmp = width*3;
var height_tmp = height*3;
imgNode.style.width = width_tmp+"px";
imgNode.style.height = height_tmp+"px";
}
</script>
</head>
<body>
<img src="image/1.jpg" id="image" onclick="zoomIn()"/>
</body>
</html>
希望可以帮到你
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询