forked from qiweile/Small-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path美女相册.html
110 lines (90 loc) · 2.94 KB
/
美女相册.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style type="text/css">
body {
font-family: "Helvetica", "Arial", serif;
color: #333;
background-color: #ccc;
margin: 1em 10%;
}
h1 {
color: #333;
background-color: transparent;
}
a {
color: #c60;
background-color: transparent;
font-weight: bold;
text-decoration: none;
}
ul {
padding: 0;
}
li {
float: left;
padding: 1em;
list-style: none;
}
#imagesgallery {
list-style: none;
}
#imagesgallery li {
margin: 0px 20px 20px 0px;
padding: 0px;
display: inline;
}
#imagesgallery li a img {
border: 0;
}
</style>
<script src="jquery-1.11.1.js"></script>
<script>
$(window).load(function () {
// <!--href: 如果什么都不写,刷新页面;(出bug最多)-->
// <!--href: #,跳转到页面最顶端;-->
// <!--href: javascript:; 点了也白点;-->
// <!--href: javascript:void(0); 点了也白点;-->
$("#imagesgallery li").delegate("a","click",function () {
$("div").siblings("img").attr('src',$(this).attr("href"))
$("div").siblings("p").html($(this).attr('title'));
// 禁止a链接跳转
return false;
})
})
</script>
</head>
<body>
<h2>
美女画廊
</h2>
<a href="#">注册</a>
<ul id="imagesgallery">
<li>
<a href="images/1.jpg" title="美女A">
<img src="images/1-small.jpg" width="100" alt="美女1" />
</a>
</li>
<li>
<a href="images/2.jpg" title="美女B">
<img src="images/2-small.jpg" width="100" alt="美女2" />
</a>
</li>
<li>
<a href="images/3.jpg" title="美女C">
<img src="images/3-small.jpg" width="100" alt="美女3" />
</a>
</li>
<li>
<a href="images/4.jpg" title="美女D">
<img src="images/4-small.jpg" width="100" alt="美女4" />
</a>
</li>
</ul>
<div style="clear:both"></div>
<img id="images" src="images/placeholder.png" width="450px" />
<p id="des">选择一个图片</p>
</body>
</html>