This article describes the method of double-clicking the image to zoom in and out by clicking out. Share it for your reference. The specific implementation method is as follows:
Copy the code as follows: <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Double-click the image to enlarge, click to zoom out</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function enlargeImage1(){
image1.height="300"
}
function dropImage1(){
image1.height="150"
}
// End -->
</script>
<table>
<tr><td align="center">
<img src="/images/3.jpg" name="image1" ondblclick="enlargeImage1()" onclick="dropImage1()" style="cursor:pointer;"/>
</td></tr>
</table>
Double-click the image to try the preview effect.
</body>
</html>
I hope this article will be helpful to everyone's JavaScript programming.