EasyUI——手风琴控件

因为网上的我找了很多 都是下载的EasyUi的包 然后导入的··  我这里不造什么原因一直下载不下来包  然后才发现 可以直接添加依赖包

	<link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/demo.css">	
    	<link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/try/jeasyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/try/jeasyui/themes/icon.css">
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="http://www.w3cschool.cc/try/jeasyui/jquery.easyui.min.js"></script>


这个样子 我感觉用到的地方挺多的 比如 导航部分(树形的) 也可以用来展示页面……

用法也很简单  外部div 设置class ="easyui-accordion"

每一层的div 设置一个title 作为QwQ 词穷了  反正就是头部  看代码吧 ……  div里面自由发挥


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
	<link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/demo.css">	
	<link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/try/jeasyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/try/jeasyui/themes/icon.css">
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="http://www.w3cschool.cc/try/jeasyui/jquery.easyui.min.js"></script>
</head>

<body>
	<div class="easyui-accordion">
		<div title="水果">          
			<ul>
				<li>西瓜</li>
				<li>苹果</li>
				<li>橘子</li>                
			</ul>
		</div>
    
		<div title="球">  
	        	<ul>
	        		<li>足球</li>
	        		<li>篮球</li>
	        	</ul>
		</div>
        	<div title="蔬菜">  
	        	<ul>
	        		<li>芹菜</li>
	        		<li>土豆</li>
                		<li>菠菜</li>
	        		<li>黄瓜</li>
	        	</ul>
		</div>
	</div>
</body>
</html>


-----------------------------------------------------------------------华丽丽的分割线----------------------------------------------------------------------

还有一种自动添加的

这个应该就是官方的Demo吧

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Accordion Actions - jQuery EasyUI Demo</title>
	
	<link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/demo.css">
	
    <link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/try/jeasyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/try/jeasyui/themes/icon.css">
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="http://www.w3cschool.cc/try/jeasyui/jquery.easyui.min.js"></script>
	
  
	<meta name="keywords" content="jquery,ui,easy,easyui,web">
	<meta name="description" content="easyui help you build your web page easily!">
</head>
<body>
	<h2>Accordion Actions</h2>
	<p>Click the buttons below to add or remove accordion items.</p>
	<div style="margin:20px 0 10px 0;">
		<a href="javascript:void(0)" class="easyui-linkbutton" οnclick="selectPanel()">Select</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" οnclick="addPanel()">Add</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" οnclick="removePanel()">Remove</a>
	</div>
	<div id="aa" class="easyui-accordion" style="width:500px;height:300px;">
		<div title="About" data-options="iconCls:'icon-ok'" style="overflow:auto;padding:10px;">
			<h3 style="color:#0099FF;">Accordion for jQuery</h3>
			<p>Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.</p>
		</div>
	</div>
	<script type="text/javascript">
		function selectPanel(){
			$.messager.prompt('Prompt','Please enter the panel title:',function(s){
				if (s){
					$('#aa').accordion('select',s);
				}
			});
		}
		var idx = 1;
		function addPanel(){
			$('#aa').accordion('add',{
				title:'Title'+idx,
				content:'<div style="padding:10px">Content'+idx+'</div>'
			});
			idx++;
		}
		function removePanel(){
			var pp = $('#aa').accordion('getSelected');
			if (pp){
				var index = $('#aa').accordion('getPanelIndex',pp);
				$('#aa').accordion('remove',index);
			}
		}
	</script>
</body>
</html>



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值