Home >Web Front-end >JS Tutorial >Two ways to change the resolution of an image using mouse move-in and move-out events_javascript skills

Two ways to change the resolution of an image using mouse move-in and move-out events_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:08:522027browse

Recently, I am doing an event of moving the mouse in and out of the picture. There are several methods you can try
The first is the two methods of changing the resolution. The resolution of the mouse moving in and out of the picture is different
Method 1

Copy code The code is as follows:




Picture list: Move the mouse in/out to change the transparency of the picture

<script> <br>window.onload = function () <br>{ <br>var oLi = document.getElementsByTagName("li"); <br>for (var i = 0; i < oLi.length; i ) <BR>{ <BR>oLi [i].onmouseover = function () <BR>{ <BR>this.className = "current" <BR>}; <BR>oLi[i].onmouseout = function () <BR>{ <BR>this. className = "" <BR>} <BR>} <BR>} <BR></script>








Method 2
Copy code The code is as follows:






Another method is to move the mouse in and out of the image to change the size of the image
Just add some code to the tag. When the mouse moves to the image, the image will become larger to the upper right. Leave the image and return it to its original size
Copy the code The code is as follows:


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn