欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

jQuery EasyUI Layout实现tabs标签的实例

程序员文章站 2022-07-06 21:06:38
jquery easyui layout实现tabs标签的实例 一、概述: 1、引入jquery.js与easyui相关文件 2、效果如图:...

jquery easyui layout实现tabs标签的实例

一、概述:

1、引入jquery.js与easyui相关文件

2、效果如图:

jQuery EasyUI Layout实现tabs标签的实例

二、创建layout主页:

<%@ page language="java" pageencoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!doctype html >
<html>
<head>
<title>sshe demo</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<script type="text/javascript" src="jslib/jquery-easyui-1.3.1/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="jslib/jquery-easyui-1.3.1/jquery.easyui.min.js"></script>
<script type="text/javascript" src="jslib/jquery-easyui-1.3.1/locale/easyui-lang-zh_cn.js"></script>
<link rel="stylesheet" href="jslib/jquery-easyui-1.3.1/themes/default/easyui.css" rel="external nofollow" type="text/css"></link>
<link rel="stylesheet" href="jslib/jquery-easyui-1.3.1/themes/icon.css" rel="external nofollow" type="text/css"></link>
<script type="text/javascript" src="jslib/syutil.js"></script>
</head>
<body class="easyui-layout">
  <div data-options="region:'north'" style="height: 60px;"></div>
  <div data-options="region:'south'" style="height: 20px;"></div>
  <div data-options="region:'west'" style="width: 200px;">
    <jsp:include page="layout/west.jsp"></jsp:include>
  </div>
  <div data-options="region:'east',title:'east',split:true" style="width: 200px;"></div>
  <div data-options="region:'center',title:'欢迎使用sshe示例系统'" style="overflow: hidden;">
    <jsp:include page="layout/center.jsp"></jsp:include>
  </div>

  <jsp:include page="user/login.jsp"></jsp:include>

  <jsp:include page="user/reg.jsp"></jsp:include>
</body>
</html>

三、创建中间页面:

<%@ page language="java" pageencoding="utf-8"%>
<script type="text/javascript">
  function addtab(opts) {
    var t = $('#layout_center_tabs');
    if (t.tabs('exists', opts.title)) {
      t.tabs('select', opts.title);
    } else {
      t.tabs('add', opts);
    }
  }
</script>
<div id="layout_center_tabs" class="easyui-tabs" data-options="fit:true,border:false" style="overflow: hidden;">
  <div title="首页"></div>
</div>

四、菜单页:west.jsp

<%@ page language="java" pageencoding="utf-8"%>
<div class="easyui-panel" data-options="title:'功能导航',border:false,fit:true">
  <div class="easyui-accordion" data-options="fit:true,border:false">
    <div title="系统菜单" data-options="iconcls:'icon-save'">
      <ul id="layout_west_tree" class="easyui-tree" data-options="
          url : '${pagecontext.request.contextpath}/menuaction!getalltreenode.action',
          parentfield : 'pid',
          lines : true,
          onclick : function(node) {
            if (node.attributes.url) {
              var url = '${pagecontext.request.contextpath}' + node.attributes.url;
              addtab({
                title : node.text,
                closable : true,
                href : url
              });
            }
          }
          "></ul>
    </div>
    <div title="title2" data-options="iconcls:'icon-reload'"></div>
  </div>
</div>

如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!