This article describes the method of JS to implement the effect of image magnifying glass. Share it for your reference. The specific implementation method is as follows:
Copy the code as follows:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JS exquisite picture magnifying glass effect</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<!--Add the following code between <head> and </head>-->
<style type="text/css">
.test{
margin:0 0 0 200px;
}
.test a{
font-size:14px;
color:#404040;
}
.test img{
border:#4b4b4b 1px solid;
}
</style>
</head>
<body>
<!--Add the following code between <body> and </body>-->
<script src="/js/magnifier.js"></script>
<div>
<h3><a target="_blank" href="">Picture I</a></h3>
<img src="/images//m01.jpg" bigsrc="/images/1.jpg">
</div>
<div>
<h3><a target="_blank" href="">Picture II</a></h3>
<img src="/images//m02.jpg" bigsrc="/images/2.jpg">
</div>
<div>
<h3><a target="_blank" href="">Picture III</a></h3>
<img src="/images//m03.jpg" bigsrc="/images/3.jpg">
</div>
</body>
</html>
Supplement: Click here to download the magnifier.js plug-in.
I hope this article will be helpful to everyone's JavaScript programming.