This article describes the method of slowly expanding the hidden image after clicking on the link by JS. Share it for your reference. The specific implementation method is as follows:
Copy the code as follows: <html>
<title>JS clicks on the link, slowly expand the hidden pictures</title>
<body>
<script language="JavaScript">
var b=0;
var c=true;
function fade(){
if(document.all);
if(c == true){b+=3}
if(b>294){c=false}
u.width=394
u.height=b; //The size of the picture after running
setTimeout("fade()",1)}//Select delay according to actual situation
</script>
<p align="center"><a href="javascript:"><img src="/images/3.jpg" name="u" onclick="javascript:window.open(this.src);" style="cursor:pointer;"/></a>
<p align="center"><a href="javascript:" onClick="fade()">Click to expand the picture</a>
</body>
</html>
I hope this article will be helpful to everyone's JavaScript programming.