jquery-ui 手风琴组件Accordion学习(可全部折叠)
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>jQuery UI Accordion - Collapse content</title>
	<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
	<script src="../../jquery-1.7.1.js"></script>
	<script src="../../ui/jquery.ui.core.js"></script>
	<script src="../../ui/jquery.ui.widget.js"></script>
	<script src="../../ui/jquery.ui.accordion.js"></script>
	<link rel="stylesheet" href="../demos.css">
	<script>
	//collapsible: true不设这个属性的话,默认总会有一个展开;
	//设为true就可以全部折叠起来
	$(function() {
		$( "#accordion" ).accordion({
			collapsible: true
		});
	});
	</script>
</head>
<body>
 
<div class="demo">
 
<div id="accordion">
	<h3><a href="#">第1个菜单 1</a></h3>
	<div>
		<p>第1个菜单 1的内容</p>
	</div>
	<h3><a href="#">第2个菜单 2</a></h3>
	<div>
		<p>第2个菜单 2的内容 </p>
	</div>
	<h3><a href="#">第3个菜单 3</a></h3>
	<div>
		<p>第3个菜单 3的内容 </p>
		<ul>
			<li>List item one</li>
			<li>List item two</li>
			<li>List item three</li>
		</ul>
	</div>
	<h3><a href="#">第4个菜单 4</a></h3>
	<div>
		<p>第4个菜单 4的内容</p>
	</div>
</div>
 
</div><!-- End demo -->
 
 
 
<div class="demo-description">
<p>By default, accordions always keep one section open. To allow for all sections to be be collapsible, set the <code>collapsible</code> option to true. Click on the currently open section to collapse its content pane.</p>
</div><!-- End demo-description -->
 
</body>
</html>


阅读更多
个人分类: jquery-ui 组件
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

jquery-ui 手风琴组件Accordion学习(可全部折叠)

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭