Preface
First, what do you want to achieve? , There are pictures on the page , When you move the mouse over the picture , the effect of the picture is enlarged and suspended. . Several methods have been tested , like using mouse events to control Div There are other ways of showing and hiding pictures, and finally using open source JS to achieve the hover effect of the picture.
effect
First of all, when the mouse moved to the picture, the picture will be enlarged hover to the middle of the page, when the mouse moved, the picture will disappear from the suspended page, the original style on the page will not have any changes.
Implement
After reading, let's look at the implementation process:
<span style= "font-family:kaiti_gb2312;" >//reference JS and CSS files
This is just an implementation of the picture suspension Demo , in Demo in fact, the same picture is two, one is a large picture, a small picture, in fact, an image can be achieved, as long as we set the size of the picture can be, if we need to use the project, only need to load the corresponding picture.
about the JS the code of the writing, here just set the hover effect to display the location and picture size, and the suspension effect of the specific implementation is in the corresponding JS the.
Summarywhen we want to implement a function, there must be a number of ways. We have to learn to stand on the shoulders of giants, there is no need to say that we have to encapsulate such a set of JS to achieve a variety of functions, standing on the shoulders of giants, more convenient and fast to achieve our function.
Java SSH Project Summary--JS implementation picture suspension