first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<!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>图片预览</title>
<link rel="stylesheet" href="./css/clear.css">
<link rel="stylesheet" href="http://at.alicdn.com/t/font_2576965_g3xukxxa1z.css">
<link rel="stylesheet" href="./css/ImagePreview.css">
<style>
.smail {
width: 100px;
}
</style>
</head>
<body>
<div class="imgList"></div>
</body>
<script src="./js/ImagePreview.js"></script>
<script>
var img = ['./img/1.jpg', './img/2.jpg', './img/3.jpg', './img/4.jpg']
img.forEach(v => {
document.querySelector(".imgList").innerHTML += `<img class="smail" src="${v}" alt="">`
})
document.querySelectorAll(".imgList img").forEach((v, i) => {
v.onclick = () => {
console.log(v,i);
new ImagePreview({
images: img,
startPosition: i,
showPagination: true,
onChange: (index) => {
console.log("你当前切换:", index);
},
onClose() {
console.log("关闭了");
},
});
}
})
</script>
</html>