-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTAB.html
81 lines (77 loc) · 1.66 KB
/
TAB.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<script src="js/jquery-1.12.4.js"></script>
<script>
$(function(){
$('li').hover(function(){
$('li').removeClass('current');
//$(this).siblings().removeClass('current');
$(this).addClass('current');
var index = $(this).index();
$('img').removeClass('show');
//$('img').eq(index).siblings().removeClass('show');
$('img').eq(index).addClass('show');
},function(){
});
});
</script>
<style>
*{
padding:0;
margin:0;
}
.tab ul{
width:440px;
height:50px;
border:1px solid black;
list-style: none;
margin:200px auto 0;
}
div li{
float:left;
width:110px;
height:50px;
background-color:orange;
text-align: center;
line-height:50px;
}
.pic{
width:440px;
height:350px;
border:1px solid black;
margin:0 auto;
border-top:none;
}
img{
width:440px;
height:350px;
display:none;
}
.current{
background:pink;
}
.show{
display:block;
}
</style>
<body>
<div class="tab">
<ul class="nav">
<li class="current">风景1</li>
<li>风景2</li>
<li>风景3</li>
<li id="last">风景4</li>
</ul>
<div class="pic">
<img src="images/s1.png" alt="" class="show">
<img src="images/s2.png" alt="" >
<img src="images/s3.png" alt="" >
<img src="images/s4.png" alt="" >
</div>
</div>
</body>
</html>