Este artigo descreve o método do JS para implementar o efeito da lupa de imagem. Compartilhe para sua referência. O método de implementação específico é o seguinte:
Copie o código da seguinte forma: <! Doctype html public "-// w3c // dtd xhtml 1.0 transitória // pt" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title> js requintado de lupa de imagens de lupa </title>
<meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<!-Adicione o seguinte código entre <head> e </head>->
<style type = "text/css">
.teste{
margem: 0 0 0 200px;
}
.Test a {
Size da fonte: 14px;
Cor:#404040;
}
.Test img {
Fronteira:#4B4B4B 1PX SOLID;
}
</style>
</head>
<Body>
<!-Adicione o seguinte código entre <body> e </body>->
<script src = "/js/magniFier.js"> </sCript>
<div>
<H3> <a target = "_ Blank" href = ""> foto i </a> </h3>
<img src = "/imagens // m01.jpg" bigsrc = "/imagens/1.jpg">
</div>
<div>
<H3> <a target = "_ Blank" href = ""> figura ii </a> </h3>
<img src = "/imagens // m02.jpg" bigsrc = "/imagens/2.jpg">
</div>
<div>
<H3> <a target = "_ Blank" href = ""> figura iii </a> </h3>
<img src = "/imagens // m03.jpg" bigsrc = "/imagens/3.jpg">
</div>
</body>
</html>
Suplemento: Clique aqui para baixar o plug-in Magnifier.js.
Espero que este artigo seja útil para a programação JavaScript de todos.