Skip to content

Commit 6276a48

Browse files
committed
自定义事件的实现
1 parent a7c5bf2 commit 6276a48

33 files changed

+29725
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,
2+
form,fieldset,input,textarea,p,blockquote,th,td {
3+
padding: 0;
4+
margin: 0;
5+
}
6+
table {
7+
border-collapse: collapse;
8+
border-spacing: 0;
9+
}
10+
fieldset,img {
11+
border: 0;
12+
}
13+
address,caption,cite,code,dfn,em,strong,th,var {
14+
font-weight: normal;
15+
font-style: normal;
16+
}
17+
ol,ul {
18+
list-style: none;
19+
}
20+
caption,th {
21+
text-align: left;
22+
}
23+
h1,h2,h3,h4,h5,h6 {
24+
font-weight: normal;
25+
font-size: 100%;
26+
}
27+
q:before,q:after {
28+
content:'';
29+
}
30+
abbr,acronym { border: 0;
31+
}
32+
html body{
33+
height: 100%;
34+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
.btn{
2+
text-decoration: none;
3+
padding:5px 10px;
4+
width: 50px;
5+
text-align: center;
6+
display: block;
7+
margin: 100px;
8+
background: #ddd;
9+
}
10+
11+
.window_boundingBox{
12+
position: fixed;
13+
border: 1px solid #ddd;
14+
width: 500px;
15+
height: 300px;
16+
left: 50%;
17+
margin-left: -250px;
18+
top:100px;
19+
box-shadow: 0 0 12px #888;
20+
background: #fff;
21+
}
22+
23+
.window_mask{
24+
width: 100%;
25+
height: 100%;
26+
background: #000;
27+
opacity: .3;
28+
position: absolute;
29+
left: 0;
30+
top: 0;
31+
}
32+
33+
.window_alertBtn{
34+
width: 100px;
35+
position: absolute;
36+
bottom: 10px;
37+
left: 50%;
38+
margin-left: -50px;
39+
}
40+
41+
.window_header{
42+
background: #999;
43+
color: #fff;
44+
text-align: center;
45+
padding: 5px;
46+
font-size: 20px;
47+
}
48+
49+
.window_body{
50+
padding: 10px;
51+
}
52+
53+
.window_closeBtn{
54+
position: absolute;
55+
right: 0;
56+
top: 0;
57+
font-size: 20px;
58+
color: #fff;
59+
background: red;
60+
cursor: pointer;
61+
padding: 5px;
62+
}
63+
64+
/*skin for window_skin_a*/
65+
.window_skin_a.window_boudingBox{
66+
box-shadow: none;
67+
border: 5px solid #ddc;
68+
border-radius: 5px;
69+
}
70+
71+
.window_skin_a .window_alertBtn{
72+
width: 50px;
73+
left: auto;
74+
right: 20px;
75+
margin-left: 0;
76+
background:red;
77+
border: none;
78+
color: #fff;
79+
padding: 10px;
80+
}
81+
82+
.window_skin_a .window_header{
83+
background: red;
84+
text-align: left;
85+
padding: 10px;
86+
font-weight: bold;
87+
}
88+
89+
.window_skin_a .window_closeBtn{
90+
width: 45px;
91+
height: 45px;
92+
border-radius: 45px;
93+
line-height: 45px;
94+
padding: 0;
95+
text-align: center;
96+
background: blue;
97+
font-size: 24px;
98+
font-weight: bold;
99+
right: -15px;
100+
top: -15px;
101+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>自定义事件</title>
6+
<link type="text/css" rel="stylesheet" href="css/base.css">
7+
<link type="text/css" rel="stylesheet" href="css/window.css">
8+
</head>
9+
10+
<body>
11+
<a href="#" class="btn">弹窗</a>
12+
<script type="text/javascript" data-main="js/main" src="js/require.js"></script>
13+
</body>
14+
</html>

12.2 自定义事件实现(一)/js/jquery-2.1.1.min.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)