这次给大家带来jQuery EasyUI选项卡面板的tabs使用,jQuery EasyUI选项卡面板tabs使用的注意事项有哪些,下面就是实战案例,一起来看一下。

1、 对选项卡面板区域 p 设置 class=”easyui-tabs”

2、 对选项卡面板区域添加多个 p,每个 p 就是一个选项卡(每个面板一定设置 title)

3、 设置面板 fit 为 true ,自适应父容器大小

4、 设置选项卡 closable 为 true ,添加可关闭按钮

5、通过超链接,点击后,添加新的选项卡

语法: 页面对象.easyui 插件(方法名, 参数) ;

<!DOCTYPE html>
<html>
 <head>
 <meta charset="UTF-8">
 <title>easyui-选项卡面板tabs的使用</title>
 <!-- 导入jquery核心类库 -->
 <script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
 <!-- 导入easyui类库 -->
 <link id="easyuiTheme" rel="stylesheet" type="text/css" href="../js/easyui/themes/default/easyui.css" rel="external nofollow" >
 <link rel="stylesheet" type="text/css" href="../js/easyui/themes/icon.css" rel="external nofollow" >
 <link rel="stylesheet" type="text/css" href="../css/default.css" rel="external nofollow" >
 <script type="text/javascript" src="../js/easyui/jquery.easyui.min.js"></script>
 <script type="text/javascript">
  //页面加载后执行
  $(function(){
  //对链接绑定点击事件
  $("#nwtxxb").click(function(){
   //添加一个新的选项卡
   $("#mytabs").tabs('add',{
   title:'123',
   content:'456,'
   });
  });
  });
 </script>
 </head>
 <body class="easyui-layout">
 <p data-options="region:'north',title:'123'" style="height:100px"></p>
 <p data-options="region:'west',title:'菜单导航'" style="width:200px">
  <!--折叠面板-->
  <p class="easyui-accordion" data-options="fit:true">
  <p data-options="title:'基础菜单'">
   <a href="javascript:void(0)" rel="external nofollow" id="nwtxxb">123</a>
  </p>
  <p data-options="title:'系统菜单'">123</p>
  </p>
 </p>
 <p data-options="region:'center',title:'中部区域'">
  <!--选项卡面板-->
  <p id="mytabs" class="easyui-tabs" data-options="fit:true">
  <p data-options="title:'123',closable:true">后台编程</p>
  <p data-options="title:'456',closable:true">前端开发</p>
  </p>
 </p>
 <p data-options="region:'east',title:'东部区域'" style="width:100px"></p>
 <p data-options="region:'south',title:'南部区域'" style="height:100px"></p>
 </body>
</html>
登录后复制

相信看了本文案例你已经掌握了方法,更多精彩请关注Work网其它相关文章!

推荐阅读:

jQuery向动态列表添加新元素

实用的jQuery抽屉式在线客服

jquery动态合并单元格

以上就是jQuery EasyUI选项卡面板的tabs使用的详细内容,更多请关注Work网其它相关文章!

09-02 05:40