经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » JS/JS库/框架 » jQuery » 查看文章
使用jquery-easyui的布局layout写后台管理页面的代码详解
来源:jb51  时间:2019/6/20 8:34:39  对本文有异议

先在官网下载easyui文档

引入头部文件

  1. <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/themes/default/easyui.css" rel="external nofollow" rel="external nofollow" >
  2. <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/themes/icon.css" rel="external nofollow" rel="external nofollow" >
  3. <script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/jquery.min.js"></script>
  4. <script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
  5. <script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>

layout布局如下

  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <title>Java开源博客系统后台管理页面-Powered by java1234</title>
  8. <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/themes/default/easyui.css" rel="external nofollow" rel="external nofollow" >
  9. <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/themes/icon.css" rel="external nofollow" rel="external nofollow" >
  10. <script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/jquery.min.js"></script>
  11. <script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
  12. <script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
  13. <script type="text/javascript">
  14. function openTab(text,url,iconCls){
  15. if($("#tabs").tabs("exists",text)){
  16. $("#tabs").tabs("select",text);
  17. }else{
  18. var content="<iframe frameborder=0 scrolling='auto' style='width:100%;height:100%' src='/admin/"+url+"'></iframe>";
  19. $("#tabs").tabs("add",{
  20. title:text,
  21. iconCls:iconCls,
  22. closable:true,
  23. content:content
  24. });
  25. }
  26. }
  27. </script>
  28. </head>
  29. <body class="easyui-layout">
  30. <div region="north" style="height: 78px;background-color: #E0ECFF">
  31. <table style="padding: 5px" width="100%">
  32. <tr>
  33. <td width="50%">
  34. <img alt="logo" src="/static/images/logo.png">
  35. </td>
  36. <td valign="bottom" align="right" width="50%">
  37. <font size="3">  <strong>欢迎:</strong>${currentUser.userName }</font>
  38. </td>
  39. </tr>
  40. </table>
  41. </div>
  42. <div region="center">
  43. <div class="easyui-tabs" fit="true" border="false" id="tabs">
  44. <div title="首页" data-options="iconCls:'icon-home'">
  45. <div align="center" style="padding-top: 100px"><font color="red" size="10">欢迎使用</font></div>
  46. </div>
  47. </div>
  48. </div>
  49. <div region="west" style="width: 200px" title="导航菜单" split="true">
  50. <div class="easyui-accordion" data-options="fit:true,border:false">
  51. <div title="常用操作" data-options="selected:true,iconCls:'icon-item'" style="padding: 10px">
  52. <a href="javascript:openTab('写博客','writeBlog.jsp','icon-writeblog')" rel="external nofollow" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-writeblog'" style="width: 150px">写博客</a>
  53. <a href="javascript:openTab('评论审核','commentReview.jsp','icon-review')" rel="external nofollow" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-review'" style="width: 150px">评论审核</a>
  54. </div>
  55. <div title="博客管理" data-options="iconCls:'icon-bkgl'" style="padding:10px;">
  56. <a href="javascript:openTab('写博客','writeBlog.jsp','icon-writeblog')" rel="external nofollow" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-writeblog'" style="width: 150px;">写博客</a>
  57. <a href="javascript:openTab('博客信息管理','blogManage.jsp','icon-bkgl')" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-bkgl'" style="width: 150px;">博客信息管理</a>
  58. </div>
  59. <div title="博客类别管理" data-options="iconCls:'icon-bklb'" style="padding:10px">
  60. <a href="javascript:openTab('博客类别信息管理','blogTypeManage.jsp','icon-bklb')" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-bklb'" style="width: 150px;">博客类别信息管理</a>
  61. </div>
  62. <div title="评论管理" data-options="iconCls:'icon-plgl'" style="padding:10px">
  63. <a href="javascript:openTab('评论审核','commentReview.jsp','icon-review')" rel="external nofollow" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-review'" style="width: 150px">评论审核</a>
  64. <a href="javascript:openTab('评论信息管理','commentManage.jsp','icon-plgl')" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-plgl'" style="width: 150px;">评论信息管理</a>
  65. </div>
  66. <div title="个人信息管理" data-options="iconCls:'icon-grxx'" style="padding:10px">
  67. <a href="javascript:openTab('修改个人信息','modifyInfo.jsp','icon-grxxxg')" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-grxxxg'" style="width: 150px;">修改个人信息</a>
  68. </div>
  69. <div title="系统管理" data-options="iconCls:'icon-system'" style="padding:10px">
  70. <a href="javascript:openTab('友情链接管理','linkManage.jsp','icon-link')" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-link'" style="width: 150px">友情链接管理</a>
  71. <a href="javascript:openPasswordModifyDialog()" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-modifyPassword'" style="width: 150px;">修改密码</a>
  72. <a href="javascript:refreshSystem()" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-refresh'" style="width: 150px;">刷新系统缓存</a>
  73. <a href="javascript:logout()" rel="external nofollow" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-exit'" style="width: 150px;">安全退出</a>
  74. </div>
  75. </div>
  76. </div>
  77. <div region="south" style="height: 25px;padding: 5px" align="center">
  78. Copyright © 2012-2016 Java知识分享网 版权所有
  79. </div>
  80. </body>
  81. </html>

总结

以上所述是小编给大家介绍的使用jquery-easyui的布局layout写后台管理页面的代码详解,希望对大家有所帮助,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的!

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号