easyui---accordion(手风琴)
首先配置好easyui环境
1.ACCORDION(手风琴)
class:class=easyui-accordion,
事件:
查找:
function selectPanel(){ //会弹出输入框 s为自动获取输入的值
$.messager.prompt('Prompt','Please enter the panel title:',function(s){
if (s){
$('#aa').accordion('select',s); //#aa要操作的大容器
}
});
}
添加:
var idx = 1;
function addPanel(){
$('#aa').accordion('add',{ //#aa要操作的大容器
title:'Title'+idx,
content:'<div style="padding:10px">Content'+idx+'</div>' //content添加的内容,title标题
});
idx++;
}
删除:
function removePanel(){
var pp = $('#aa').accordion('getSelected'); //pp获取当前选中对象
if (pp){
var index = $('#aa').accordion('getPanelIndex',pp); //index获取当前选中对象的索引
$('#aa').accordion('remove',index);
}
}
Ajax嵌套页面:data-options="href:'ajax.html'" //ajax.html页面路径
树状图:
<ul class="easyui-tree">
这里面写ul---li
</ul>
内部 data-options="collapsed:false" //防止折叠
2.例子:
<div style="margin:20px 0 10px 0;">
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="selectPanel()">Select</a>
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="addPanel()">Add</a>
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="removePanel()">Remove</a>
</div>
<div id="aa" data-options="multiple:true" class="easyui-accordion" style="width:500px;height:500px;"><!--data-options="multiple:true"启用多个面板-->
<div title="Top Panel" data-options="iconCls:'icon-search',collapsed:false,collapsible:false" style="padding:10px;"><!--collapsed:false不可折叠-->
<input class="easyui-searchbox" prompt="Enter something here" style="width:300px;height:25px;">
</div>
<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 title="About" data-options="iconCls:'icon-ok'" style="overflow:auto;padding:10px;" >
<h3>Accordion for jQuery>sd</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>
</div>
<div title="Ajax" data-options="href:'_content.html'" style="padding:10px">
</div>
<div title="树">
<ul class="easyui-tree">
<li>
<ul>
<li>666</li>
</ul>
</li>
<li>132</li>
<li>132</li>
</ul>
</div>
<div title="数据" data-options="
selected:true,
tools:[{
iconCls:'icon-reload',
handler:function(){
$('#dg').datagrid('reload');
}
}]">
<table id="dg" class="easyui-datagrid"
data-options="url:'datagrid_data1.json',method:'get',fit:true,fitColumns:true,singleSelect:true">
<thead>
<tr>
<th data-options="field:'itemid',width:80">Item ID</th>
<th data-options="field:'productid',width:100">Product ID</th>
<th data-options="field:'listprice',width:80,align:'right'">List Price</th>
<th data-options="field:'unitcost',width:80,align:'right'">Unit Cost</th>
<th data-options="field:'attr1',width:150">Attribute</th>
<th data-options="field:'status',width:50,align:'center'">Status</th>
</tr>
</thead>
</table>
</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>
启用可多个面板:data-options="multiple:true"
效果图:

easyui---accordion(手风琴)的更多相关文章
- easyui accordion—手风琴格子始终展开和多个格子展开
来源:http://www.cnblogs.com/tylerdonet/p/3531844.html 始终打开有时候可能会很管用,其实就是一个设置问题.这里就不再介绍引用的资源了,这里只看看html ...
- EasyUI Accordion下的Panel面板初始化时全部折叠
EasyUI Accordion下的Panel面板有一个属性:selected,默认值为:false.初始化时,若设置'selected:true',则面板默认打开,效果如下: <div tit ...
- 布局-EasyUI Panel 面板、EasyUI Tabs 标签页/选项卡、EasyUI Accordion 折叠面板、EasyUI Layout 布局
EasyUI Panel 面板 通过 $.fn.panel.defaults 重写默认的 defaults. 面板(panel)当做其他内容的容器使用.它是创建其他组件(比如:Layout 布局.Ta ...
- easyui学习笔记6—基本的Accordion(手风琴)
手风琴也是web页面中常见的一个控件,常常用在网站后台管理中,这里我们看看easyui中基本的手风琴设置. 1.先看看引用的资源 <meta charset="UTF-8" ...
- Accordion - 手风琴
//手风琴效果 <div style="overflow:hidden;height:400px;width:948px;"> <div class=" ...
- Jquery UI accordion手风琴菜单
最近学习jQuery,总结了一些心得. 1.引用 <script type="text/javascript" src=jquery.js></script> ...
- jquery easyui Accordion的使用
<html> <head> <script src="jquery-easyui/jquery.min.js"></script> ...
- 使用jQuery开发accordion手风琴插件
一.插件效果 手风琴插件常用的功能均已实现,包括:手风琴菜单项的折叠展开效果.选中指定菜单项.判断菜单项是否选中等. 效果如下: 二.插件内部HTML元素结构 <!-- accordioon组件 ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统(38)-Easyui-accordion+tree漂亮的菜单导航
系列目录 本节主要知识点是easyui 的手风琴加树结构做菜单导航 有园友抱怨原来菜单非常难看,但是基于原有树形无限级别的设计,没有办法只能已树形展示 先来看原来的效果 改变后的效果,当然我已经做好了 ...
- EasyUI配置和组件
首先在webcontent添加配置文件 新建静态或动态网站,在title的下面加入五个配置文件路径,注意:循序不能乱 <!-- 顺序不可以乱 --> <!-- 1.jQuery的js ...
随机推荐
- IP服务-计算机网络
如需转载请联系:fengxw6@mail2.sysu.edu.cn 未经许可,禁止转载,私人笔记,码字不易,望理解. ---Sun Yat-sen University 冯兴伟 本节主要就讲网络层的各 ...
- Storm worker 并行度等理解
Storm 调优是非常重要的, 仅次于写出正确的代码, 好在Storm官网上有关于worker executors tasks的介绍, http://storm.incubator.apache.or ...
- VS调试的问题
调试Vs,使用本地IIS也不行,使用外部服务器也不行,最后运行VS2013以管理员身份就可以了
- 1131 Subway Map(30 分)
In the big cities, the subway systems always look so complex to the visitors. To give you some sense ...
- 多线程之:java的CAS操作的相关信息
一:锁机制存在的性能问题? 在JDK 5之前Java语言是靠synchronized关键字保证同步的,这会导致有锁(后面的章节还会谈到锁). 锁机制存在以下问题:(1)在多线程竞争下,加锁.释放锁会导 ...
- mac下配置xampp的vhost
1 先确定在httpd.conf文件(/Applications/XAMPP/xamppfiles/etc/httpd.conf)中,引入了vhosts.conf文件. 1.1 在httpd.conf ...
- Unix Timestamp
class Foundation_API DateTime /// This class represents an instant in time, expressed /// in years, ...
- shell expr 的使用注意事项
#!/bin/bash a=10 b=20 c=`expr $a + $b` echo "a + b :$c" c='expr $a + $b' echo "a + b ...
- AD 学习
http://blog.csdn.net/lingpaoershiyishiji/article/details/9139527
- sublime Text3支持vue高亮,sublime Text3格式化Vue
第一:让sublime Text3支持Vue高亮 PS:我的sublime版本是3126,我不清楚其它版本的是不是这样设置,不过可以看看思路自己摸索下 1.下载可以让vue格式高亮的插件vue-syn ...