tab.jsp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  3. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
  4. <%
  5. String path = request.getContextPath();
  6. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  7. %>
  8. <!DOCTYPE html>
  9. <html lang="en">
  10. <head>
  11. <base href="<%=basePath%>">
  12. <script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
  13. <script type="text/javascript" src="plugins/tab/js/framework.js"></script>
  14. <link href="plugins/tab/css/import_basic.css" rel="stylesheet" type="text/css"/>
  15. <link rel="stylesheet" type="text/css" id="skin" prePath="plugins/tab/" /><!--默认相对于根目录路径为../,可添加prePath属性自定义相对路径,如prePath="<%=request.getContextPath()%>"-->
  16. <script type="text/javascript" charset="utf-8" src="plugins/tab/js/tab.js"></script>
  17. </head>
  18. <body>
  19. <div id="tab_menu"></div>
  20. <div style="width:100%;">
  21. <div id="page" style="width:100%;height:100%;"></div>
  22. </div>
  23. </body>
  24. <script type="text/javascript">
  25. function tabAddHandler(mid,mtitle,murl){
  26. if(mtitle.indexOf("---")!=-1){
  27. mtitle = mtitle.split('---')[0].replace("立项详表","");
  28. }
  29. tab.update({
  30. id :mid,
  31. title :mtitle,
  32. url :murl,
  33. isClosed :true
  34. });
  35. tab.add({
  36. id :mid,
  37. title :mtitle,
  38. url :murl,
  39. isClosed :true
  40. });
  41. tab.activate(mid);
  42. }
  43. var tab;
  44. $( function() {
  45. debugger;
  46. tab = new TabView( {
  47. containerId :'tab_menu',
  48. pageid :'page',
  49. cid :'tab1',
  50. position :"top"
  51. });
  52. tab.add( {
  53. id :'tab1_index1',
  54. title :"主页",
  55. url :"<%=basePath%>annualPlanComp/list.do",
  56. isClosed :false
  57. });
  58. /**tab.add( {
  59. id :'tab1_index1',
  60. title :"主页",
  61. url :"/per/undoTask!gettwo",
  62. isClosed :false
  63. });
  64. **/
  65. });
  66. function cmainFrameT(){
  67. var hmainT = document.getElementById("page");
  68. var bheightT = document.documentElement.clientHeight;
  69. hmainT .style.width = '100%';
  70. hmainT .style.height = (bheightT - 41) + 'px';
  71. }
  72. cmainFrameT();
  73. window.onresize=function(){
  74. cmainFrameT();
  75. };
  76. </script>
  77. </html>