-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
74 lines (74 loc) · 1.68 KB
/
demo.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=medium-dpi,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui" /> <!--屏幕缩放-->
<title>Document</title>
<style type="text/css">
body{
background-color: #f3f3f3;
}
.main{
display: block;
margin:0 1.6em;
text-align: center;
}
.fill,.full{
width: 130px;
height: 130px;
border:1px solid #999;
margin: 5px;
/*background: url(bg.png) repeat;*/
/* float: left; */
background-color: white;
background-image:
linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc),
linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
background-size: 12px 12px;
background-position: 0 0, 6px 6px;
text-align: left;
display: inline-block;
}
</style>
<script type="text/javascript" src="jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="jquery.showImg.min.js"></script>
<script type="text/javascript">
$(function () {
$(".fill").showImg({
'type':'fill',//(填满-溢出隐藏)
});
$(".full").showImg({
'type':'full',//(完整显示-多余部分留白)
});
})
</script>
</head>
<body>
<div class="main">
<div class="fill">
<img src="1.jpg"/>
</div>
<div class="full">
<img src="1.jpg"/>
</div>
<div class="fill">
<img src="2.jpg"/>
</div>
<div class="full">
<img src="2.jpg"/>
</div>
<div class="fill">
<img src="3.jpg"/>
</div>
<div class="full">
<img src="3.jpg"/>
</div>
<div class="fill">
<img src="4.jpg"/>
</div>
<div class="full">
<img src="4.jpg"/>
</div>
</div>
</body>
</html>