Html
    Css
    Js
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
<div class="box">
<h1></h1>
<ul>
<li><span>1</span>
<div class="content">
<img src="http://www.jq22.com/img/cs/300x500-1.png" alt="">
<p>????
</p>
</div>
</li>
<li><span>2</span>
<div class="content">
<img src="http://www.jq22.com/img/cs/300x500-2.png" alt="">
<p>????1994914
</p>
</div>
</li>
<li><span>3</span>
<div class="content">
<img src="http://www.jq22.com/img/cs/300x500-3.png" alt="">
<p>1993
</p>
</div>
</li>
<li><span>4</span>
<div class="content">
<img src="http://www.jq22.com/img/cs/300x500-4.png" alt="">
<p>????
</p>
</div>
</li>
<li><span>5</span>
<div class="content">
<img src="http://www.jq22.com/img/cs/300x500-5.png" alt="">
<p>????1994914
</p>
</div>
</li>
<li><span>6</span>
<div class="content">
<img src="http://www.jq22.com/img/cs/300x500-6.png" alt="">
<p>1993
</p>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
* {
margin:0;
padding:0;
}
html,body {
width:100%;
height:100%;
}
.box {
width:300px;
height:450px;
margin:50px auto;
border:1px solid #000;
}
.box>h1 {
font-size:20px;
line-height:35px;
color:chocolate;
padding-left:10px;
border-bottom:1px dashed #ccc;
}
ul>li {
list-style:none;
padding:5px 10px;
border:1px dashed #ccc;
}
ul>li:nth-child(-n+3) span {
background:chocolate;
}
ul>li>span {
display:inline-block;
width:20px;
height:20px;
background:#ccc;
line-height:20px;
text-align:center;
margin-right:10px;
}
.content {
overflow:hidden;
margin-top:5px;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$(function() {
// $("li").mouseenter(function() {
// $(this).addClass("current")
// });
// $("li").mouseleave(function() {
// $(this).removeClass("current")
// });
$("li").hover(function() {
$(this).addClass("current")
},
function() {
$(this).removeClass("current")
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
↑上面代码改变,会自动显示代码结果 jQuery调用版本:2.1.4
 立即下载

jquery电影排行榜列表

更新时间:2019-12-22 22:47:54

主要利用jquery中的addclass和removeclass先隐藏再显示

0