This time I will show you how to use jquery to create amagnifying glass effect, what are theprecautionsfor using jquery to create a magnifying glass effect, the following is a practical case, let’s take a look .
The two magnifying glass effects written in jquery do not use plug-ins. Conditioning and clarity of thought. It is not written in anobject-orientedway, so it is easier for beginners to understand. Without further ado, let’s look at the code. The pictures will not be uploaded here, you can find them by yourself. It is best to find the proportion, so the effect is better.
css code
*{padding: 0; margin: 0;} #father .small{width: 50px; height: 50px; border: 2px solid #ccc; bottom: 0; position: absolute;} #father .second{left: 70px;} .third{left: 140px;} #father{position: relative; top: 100px; left: 50px; height: 460px;} #container{position: absolute; width: 400px; height: 400px;} #container img{position: absolute; display: none;} .shade{width: 200px; height: 200px; position: absolute; background: #000; opacity: 0.4; top: 0; left: 0; display: none;} .big{width: 400px; height: 400px; position: absolute; top: 100px; overflow: hidden; left: 500px; display: none;} .big img{width: 800px; height: 800px; position: absolute; display: none;}
js code
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
jquery adds HTML tags with styles
##How jquery binds events to dynamically generated tags
How does jQuery get the value of the tag sub-element
How does jQuery get and modify the value of the P tag
The above is the detailed content of How to create a magnifying glass effect using jquery. For more information, please follow other related articles on the PHP Chinese website!