亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

頁面中常用平級下拉菜單(手風(fēng)琴)

asal 2019-03-18 15:54:41 302
abstrak:demo.html: <!DOCTYPE html> <html lang="en"> <head> <title>頁面中常用平級下拉菜單(手風(fēng)琴)</title> <link rel="stylesheet" href="static/css
demo.html:
<!DOCTYPE html>
<html lang="en">
<head>
<title>頁面中常用平級下拉菜單(手風(fēng)琴)</title>
<link rel="stylesheet" href="static/css/demo.css">
<link rel="stylesheet" href="static/font-awesome/css/font-awesome.min.css">
<link rel="shortcut icon" href="static/images/logo.png" type="image/x-icon">
<script src="static/js/jquery.js"></script>
</head>
<body>
<div class="nav">
<div class="parent">
<div class="one">
<strong>個人中心</strong>
</div>
<ul class="two">
<li><a href=""></a>我的信息</li>
<li><a href=""></a>系統(tǒng)通知</li>
<li><a href=""></a>短信息</li>
</ul>
</div>
<div class="parent">
<div class="one">
<strong>課程中心</strong>
</div>
<ul class="two">
<li><a href=""></a>我的信息</li>
<li><a href=""></a>系統(tǒng)通知</li>
<li><a href=""></a>短信息</li>

<ul>
</div>
<div class="parent">
<div class="one">
<strong>校內(nèi)討論</strong>
</div>
<ul class="two">
<li><a href=""></a>我的信息</li>
<li><a href=""></a>系統(tǒng)通知</li>
<li><a href=""></a>短信息</li>

</ul>
</div>
<div class="parent">
<div class="one">
<strong>資源中心</strong>
</div>
<ul class="two">
<li><a href=""></a>我的信息</li>
<li><a href=""></a>系統(tǒng)通知</li>
<li><a href=""></a>短信息</li>

</ul>
</div>
</div>

<script>
$(function(){
$('.two').css('display','none');
var one=$('.one');
var two=$('.two');
//each() 方法規(guī)定為每個匹配元素規(guī)定運行的函數(shù)。
$('.one').each(function(i){
$(this).click(function(){
if($(two[i]).css('display')=='none'){
$(two[i]).slideDown(400)
}else{
$(two[i]).slideUp(400)
};
});
});
});
</script>
</body>
</html>

demo.css:
*{
margin: 0px;
padding: 0px;
font-size: 14px;
font-family: "微軟雅黑";
}
a{
text-decoration:none;
color: #36b2f5;
}


.nav{
width: 250px;
margin: 70px auto;
border-top: 4px solid #36b2f5;
border-bottom: 3px solid #36b2f5;
}
.nav .one{
border-bottom: 1px solid #36b2f5;
border-right: 1px solid #36b2f5;
border-left: 1px solid #36b2f5;
height: 40px;
line-height: 40px;
text-align: center;
cursor: pointer;
}
.two{
width: 248px;
border-right: 1px solid #36b2f5;
border-left: 1px solid #36b2f5;
}
.two li{
list-style: none;
height: 35px;
line-height: 35px;
text-align: center;
border-bottom: 1px dotted #36b2f5;
}


Guru membetulkan:滅絕師太Masa pembetulan:2019-03-18 16:58:06
Rumusan guru:完成的不錯,除了上課案例,還可以自行拓展.

Nota Keluaran

Penyertaan Popular