-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path手风琴.html
127 lines (119 loc) · 2.51 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
html,body,div {
margin: 0;
padding: 0;
}
.container {
width: 300px;
position: fixed;
right: 0;
}
.container .item {
color: #fff;
border-bottom: 1px solid #fff;
}
.container .item .item-title {
height: 40px;
background-color: #000;
cursor: pointer;
}
.container .item .item-content {
background-color: #c33;
height: 0px;
overflow: hidden;
}
.container .item .item-content.current {
height: 100px;
}
.con {
width: 1500px;
margin-left: 100px;
}
.content {
width: 900px;
}
.content .div {
float: left;
width: 150px;
height: 300px;
}
.content .div:nth-child(1){
background: url(img/photo01.jpg) no-repeat center;
}
.content .div:nth-child(2){
background: url(img/photo02.jpg) no-repeat center;
}
.content .div:nth-child(3){
background: url(img/photo03.jpg) no-repeat center;
}
.content .div:nth-child(4){
background: url(img/photo04.jpg) no-repeat center;
}
.content .div:nth-child(5){
background: url(img/photo05.jpg) no-repeat center;
}
</style>
</head>
<body>
<div class="container">
<div class="item">
<div class="item-title">1</div>
<div class="item-content current">内容1</div>
</div>
<div class="item">
<div class="item-title">2</div>
<div class="item-content">内容2</div>
</div>
<div class="item">
<div class="item-title">3</div>
<div class="item-content">内容3</div>
</div>
<div class="item">
<div class="item-title">4</div>
<div class="item-content">内容4</div>
</div>
<div class="item">
<div class="item-title">5</div>
<div class="item-content">内容5</div>
</div>
</div>
<div class="con">
<div class="content">
<div class="div first">
</div>
<div class="div">
</div>
<div class="div">
</div>
<div class="div">
</div>
<div class="div">
</div>
</div>
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
'use strict';
$(function(){
var item = $('.container .item');
item.click(function(){
$(this).find('.item-content').animate({height:100});
$(this).siblings().find('.item-content').animate({height:0});
});
var div = $('.content .div');
div.hover(function(){
$(this).stop(true).animate({width: 200});
$(this).siblings().stop(true).animate({width: 138});
});
$('.content').mouseleave(function(){
div.stop(true).animate({width: 150});
})
});
</script>
</body>
</html>