网站前端_EasyUI.基础入门.0005.使用EasyUI Accordion组件的最佳姿势?
1. 基础的手风琴
<div id="a" class="easyui-accordion" data-options="width:500,height:300"> <div data-options="iconCls:'icon-ok',title:'about',bodyCls:'accordion_padding'"> <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 data-options="iconCls:'icon-help',title:'help',bodyCls:'accordion_padding'"> <p>The accordion allows you to provide multiple panels and display one or more at a time. Each panel has built-in support for expanding and collapsing. Clicking on a panel header to expand or collapse that panel body. The panel content can be loaded via ajax by specifying a 'href' property. Users can define a panel to be selected. If it is not specified, then the first panel is taken by default.</p> </div> <div data-options="iconCls:'icon-search',title:'tree',bodyCls:'accordion_padding'"> <ul class="easyui-tree"> <li> <span>第一层</span> <ul> <li>第1层</li> <li>第2层</li> <li>第3层</li> </ul> </li> <li>第二层</li> <li>第三层</li> </ul> </div> </div>
2. 流式的手风琴
<div style="width:500px;height:300px;"> <div id="a" class="easyui-accordion" data-options="fit:true"> <div data-options="iconCls:'icon-ok',title:'About',bodyCls:'accordion_padding'"> <p>width: 100%</p> </div> <div data-options="iconCls:'icon-help',title:'help',bodyCls:'accordion_padding',href:'_contents.html'"></div> </div> </div>
3. 异步加载数据
<div style="width:500px;height:300px;"> <div id="a" class="easyui-accordion" data-options="fit:true"> <div data-options="iconCls:'icon-help',title:'help',bodyCls:'accordion_padding',href:'_contents.html',cache:false"></div> </div> </div>
4. 手风琴的控制
<div> <a href="javascript:void(0);" class="easyui-linkbutton" onclick="javascript:select();">选中</a> <a href="javascript:void(0);" class="easyui-linkbutton" onclick="javascript:add();">添加</a> <a href="javascript:void(0);" class="easyui-linkbutton" onclick="javascript:remove();">删除</a> </div> <hr> <div id="a" class="easyui-accordion" data-options="width:500,height:300"> <div data-options="iconCls:'icon-ok',title:'about',bodyCls:'accordion_padding'">about</div> <div data-options="iconCls:'icon-help',title:'help',bodyCls:'accordion_padding'">help</div> </div> <!-- 说明: 加载jquery-easyui脚本文件 --> <script src="js/jquery-easyui/jquery.min.js"></script> <script src="js/jquery-easyui/jquery.easyui.min.js"></script> <script src="js/jquery-easyui/locale/easyui-lang-zh_CN.js"></script> <script type="text/javascript"> function select(){ $.messager.prompt('信息', '请输入你要选中的面板标题或面板索引?', function(data){ var n = parseInt(data); console.log(data, typeof(data)); if(!isNaN(n)){ $('#a').accordion('select', n); }else{ $('#a').accordion('select', data); }; }); }; function add(){ var options = { iconCls: 'icon-reload', title: 'reload', content: 'reload', bodyCls: 'accordion_padding', }; $('#a').accordion('add', options); }; function remove(){ var selectedItem = $('#a').accordion('getSelected'); var selectedIndex = $('#a').accordion('getPanelIndex', selectedItem); $('#a').accordion('remove', selectedIndex); }; </script>
5. 手风琴工具组
<div id="a" class="easyui-accordion" data-options="width:500,height:200"> <div data-options="iconCls:'icon-ok',title:'datagrid',tools:[{ iconCls: 'icon-reload', handler: function(){ $('#tb').datagrid('reload'); } }]"> <table id="tb" class="easyui-datagrid" data-options="url:'/easyui/data.json',method:'get',fit:true,fitcolumns:true,singleSelect:true"> <thead> <tr> <th data-options="field:'name',width:'20%'">姓名</th> <th data-options="field:'age',width:'60%'">年龄</th> <th data-options="field:'sex',width:'20%',align:'right'">性别</th> </tr> </thead> </table> </div> </div>
6. 打开的手风琴
<div id="a" class="easyui-accordion" data-options="width:500,height:200"> <div style="padding: 5px;" data-options="iconCls:'icon-search',title:'搜索',collapsed:false,collapsible:false"> <input class="easyui-searchbox" data-options="fit:true,prompt:'search something'" type="search"> </div> <div style="padding: 5px;" data-options="iconCls:'icon-about',title:'about',selected:true"> <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>
7. 开多个手风琴
<div id="a" class="easyui-accordion" data-options="width:500,multiple:true"> <div data-options="iconCls:'icon-ok',title:'PYTHON',bodyCls:'accordion_padding'">PYTHON</div> <div data-options="iconCls:'icon-ok',title:'HTML',bodyCls:'accordion_padding'">HTML</div> </div>
注意: 配合容器multiple属性可支持同时展开多个,但是此模式下千万别设置容器的高度,不然由于上一个面板已经展开,下一个面板由于空间被占且高度被限制会导致显示不出来.

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
Docker分离部署MySQL、Nginx+Tomcat复制共享
防伪码:失去只是一种姿势,得到并不等同于幸福 项目需求: 1、nginx容器作为整个架构中前端服务器监听80端口接收用户的jsp页面请求,并将用户的jsp请求分发给tomcat web容器,tomcat容器需要连接mysql数据库容器。 2、nginx容器做为前端服务器可以直接响应用户的静态页面请求,jsp动态页面请求交给tomcat容器处理(静动分离) 3、通过session复制共享:session replication,实现tomcat服务器之间同步session,使session保持一致。 注:http://yw666.blog.51cto.com/11977292/1888747,session复制共享在前文详细讲解过,此处不再赘述。 如图所示: 制作nginx镜像 fromdocker.io/centos:centos6 addnginx-1.6.0/nginx-1.6.0 runyum-yinstallgccpcrepcre-develzlib-develmake runuseraddnginx-s/sbin/nologin runcd/nginx-1.6.0&&...
- 下一篇
部署 Office Online Server 2016
部署 Office Online Server 2016 简介: 配置 Office Online Server 2016,用户可以在 Outlook 网页版中查看受支持的文件附件,而无需下载这些附件,也无需在本地安装相关程序。如果没有安装 Office Online Server,则 Outlook 用户需要将附件下载到其本地计算机上,然后在本地应用程序中将其打开。 本文环境: AD、Exchange: EXDC1 OS: Windows Server 2012 r2/ExchangeServer 2016 cu3 Office OnlineServer: OOSERVER OS: Windows Server 2012r2 /Office Online Server 2016 一、Office Online Server 系统要求 Office OnlineServer 要求安装了以下各项: Windows Server 2012 R2 Exchange 2016 累积更新 1 (CU1) 或后续更新 Microsoft .NET Framework 4.5.2 Visual C...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- Red5直播服务器,属于Java语言的直播服务器
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- SpringBoot2整合Redis,开启缓存,提高访问速度
- CentOS关闭SELinux安全模块
- SpringBoot2整合MyBatis,连接MySql数据库做增删改查操作
- SpringBoot2初体验,简单认识spring boot2并且搭建基础工程
- SpringBoot2编写第一个Controller,响应你的http请求并返回结果
- CentOS8安装MyCat,轻松搞定数据库的读写分离、垂直分库、水平分库
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- CentOS8编译安装MySQL8.0.19