页面中平级下拉手风琴效果

Original 2019-04-17 12:07:30 218
abstract:<!DOCTYPE html><html><head><title>页面中常用平级下拉菜单(手风琴)</title><meta charset="UTF-8"><link rel="shortcut icon"  href="static/images/logo

<!DOCTYPE html>

<html>

<head>

<title>页面中常用平级下拉菜单(手风琴)</title>

<meta charset="UTF-8">

<link rel="shortcut icon"  href="static/images/logo.png" type="image/x-icon" />

<link rel="stylesheet" href="static/css/style.css" type="text/css">

<script type="text/javascript" src="static/js/jquery.js"></script>  

<script type="text/javascript">

$(function(){

$('.two').css('display','none')

var one=$('.one')

var two=$('.two')

$('.one').each(function(i){

$(this).click(function(){

if($(two[i]).css('display')=='none'){

$(two[i]).slideDown(400)

}else{

$(two[i]).slideUp(400)

}




})




})




})


</script>

</head>

<body>

<div class="nav">

<div class="parent">

<div class="one">

<strong>个人中心</strong>

</div>

<div class="two">

<div><a href="">我的信息</a></div>

<div><a href="">系统通知</a></div>

<div><a href="">短信息</a></div>

</div>

</div>

<div class="parent">

<div class="one">

<strong>课程中心</strong>

</div>

<div class="two">

<div> <a href="#">我的课程</a></div>

<div> <a href="#">课程资源</a></div>

<div> <a href="#">班级统计</a></div>

<div> <a href="#">课程题库</a></div>

</div>

</div>

<div class="parent">

<div class="one">

<strong>校内讨论</strong>

</div>

<div class="two">

<div> <a href="#">我的帖子</a></div>

<div> <a href="#">新回复</a></div>

<div> <a href="#">课程板块</a></div>

<div> <a href="#">问答中心</a></div>

</div>

</div>

<div class="parent">

<div class="one">

<strong>资源中心</strong>

</div>

<div class="two">

<div> <a href="#">教学资源</a></div>

<div > <a href="#">教学经历</a></div>

</div>

</div>





</div>

</body>

</html>


Correcting teacher:天蓬老师Correction time:2019-04-17 13:59:50
Teacher's summary:这是一个典型的事件控制页面元素的显示案例, 这样的技巧 , 在很多地方都可以用到的

Release Notes

Popular Entries