-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodal-preview.html
49 lines (40 loc) · 1.28 KB
/
modal-preview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>modal</title>
<link rel="stylesheet" type="text/css" href="css/ch-ui.css"/>
<style type="text/css">
.small-img{
width: 360px;
height: 180px;
}
</style>
</head>
<body>
<img src="imgs/e1.jpg" class="small-img">
<img src="imgs/e2.jpg" class="small-img">
<img src="imgs/e3.jpg" class="small-img">
<img src="imgs/e4.jpg" class="small-img">
<img src="imgs/e5.jpg" class="small-img">
<img src="imgs/e6.jpg" class="small-img">
<div class='ch-ui-modal' id="modal">
<div class='ch-ui-modal-backdrop'></div>
<div class='ch-ui-modal-content'>
<div class="cancel" style="position: absolute;top: 0;right: 0;font-size: 20px;color: #ffffff;cursor: pointer">×</div>
<img src="imgs/e1.jpg" style="width: 100%;height: 100%;border-radius: 3px">
</div>
</div>
<script src="js/libs/bower_components/jquery/dist/jquery.js"></script>
<script src="js/apps/ch-ui.js"></script>
<script>
$(".small-img").modal({
area: [720,405],
relatedModal: "#modal",
cancelElements: [".cancel"]
}).on("show-before",function (evt) {
$("#modal img").attr("src",evt.target.src);
});
</script>
</body>
</html>