1.0.1 • Published 2 years ago
fdjbs v1.0.1
黑白图片鼠标移到的位置变为彩色放大镜,示例代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style type="text/css">
*{margin: 0;padding: 0;}
html,body{width: 100%;height: 100%;overflow: hidden;}
#div{
width: 100px;
height: 100px;
background: url(./img/1.jpeg) no-repeat;
background-position: 0 0;
position: absolute;
pointer-events: none;
display: none;
}
img{width: 30%;height: 30%;}
</style>
<body>
<div id="div"></div>
<img id="Image1" src="./img/2.jpg" alt="tp">
</body>
</html>
<script src="./node_modules/fdjbs/index.js"></script>
<script>
//配置参数
var imgBsObj= {
"samllBoxId":"div",//小框的id
"imgID":"Image1",//图片id
}
event();
</script>