zoukankan      html  css  js  c++  java
  • 最好的教程是官方的文档和手册

    最近几天来回折腾EASY UI ,虽然界面难看了些,但功能还算全备。

    布局:

      1 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
      2 <%@include file="/taglibs.jsp" %>
      3 <html>
      4 <head>
      5 
      6 <title>羚锐信息综合管理平台 </title>
      7     <style type="text/css">  
      8         #menu {  
      9             width:200px;
     10      
     11             /*border:1px solid red;*/  
     12         }  
     13         #menu ul {  
     14             list-style: none;  
     15             padding: 0px;  
     16             margin: 0px;  
     17         
     18         }  
     19         #menu ul li {  
     20             border-bottom: 1px solid #fff;
     21             text-align: center;  
     22   
     23         }  
     24         #menu ul li a {  
     25             /*先将a标签转换为块级元素,才能设置宽和内间距*/  
     26             display: block;  
     27             background-color: #458fce;  
     28             color: #fff;  
     29             padding: 5px;  
     30 
     31             text-decoration: none;  
     32         }  
     33         #menu ul li a:hover {  
     34             background-color: #008792;  
     35         }  
     36           
     37     </style> 
     38 </head>
     39 <script type="text/javascript">  
     40         function addTab(title, url){
     41             if ($('#tt').tabs('exists', title)){
     42                 $('#tt').tabs('select', title);
     43             } else {
     44                 var content = '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="100%;height:100%;"></iframe>';
     45                 $('#tt').tabs('add',{
     46                     title:title,
     47                     content:content,
     48                     closable:true
     49                 });
     50             }
     51         }
     52 </script>
     53 <body class="easyui-layout">
     54     <div region="north" style="height: 65px; background: #458fce; border="false">  
     55             <div style="float:left" ><img src="${basePath }/img/logo.png"/></div>
     56             <div style="float:right;" ><h1 style="color:white;" >当前用户:${username} <a href="${basePath}/logout">退出</a></h1></div>
     57     
     58     </div>
     59     <div region="west" style=" 200px" title="快速导航" split="true">  
     60             <div data-options="border:false" class="easyui-accordion" style="200px;">   
     61                 <div id="menu" title="用户管理" data-options="iconCls:'icon-save',selected:true" >   
     62                     <ul>
     63                         <li><a href="#"  onclick="addTab('用户管理','${basePath }/items/list')">用户添加</a>
     64                         <li><a href="#"  onclick="addTab('lingrui','http://www.lingrui.com')">lingrui</a>
     65                     </ul>
     66                 </div>   
     67                 <div title="权限管理" data-options="iconCls:'icon-reload'" style="padding:10px;">   
     68                     content2    
     69                 </div>   
     70                 <div title="客户管理" data-options="iconCls:'icon-reload'" style="padding:10px;">   
     71                     content2    
     72                 </div>   
     73                 <div title="物料管理" data-options="iconCls:'icon-reload'" style="padding:10px;">   
     74                     content2    
     75                 </div>   
     76                 
     77                 <div title="菜单管理">   
     78                     <div style="margin-bottom:10px">
     79                         <a href="#" class="easyui-linkbutton" onclick="addTab('google','http://www.google.com')">google</a>
     80                         <a href="#" class="easyui-linkbutton" onclick="addTab('jquery','http://jquery.com/')">jquery</a>
     81                         <a href="#" class="easyui-linkbutton" onclick="addTab('easyui','http://jeasyui.com/')">easyui</a>
     82                     </div>
     83                 </div>   
     84             </div>  
     85     </div>
     86     <div data-options="region:'center'" style="background:#eee;">  
     87     
     88         <div id="tt" class="easyui-tabs" fit="true" ">  
     89             <div title="首页" data-options="iconCls:'icon-home'">
     90                 <div align="center" style="padding-top: 100px"><font color="red" size="10">欢迎使用<br>羚锐综合管理平台</font></div>  
     91             </div>  
     92         </div>
     93         
     94     </div>
     95     <div region="south" style="height: 25px;padding: 5px" align="center"> 
     96      Copyright © 2018-2020 河南羚锐制药股份有限公司 版权所有 
     97     </div>
     98 </body>
     99 
    100 
    101 </html>

    其中,为了在tabs框中打开指定地址,来回折腾多次,最后,还是通过在线文档,用简单的方法测试通过。

    http://www.jeasyui.net/tutorial/17.html

    <div style="margin-bottom:10px">
    	<a href="#" class="easyui-linkbutton" onclick="addTab('google','http://www.google.com')">google</a>
    	<a href="#" class="easyui-linkbutton" onclick="addTab('jquery','http://jquery.com/')">jquery</a>
    	<a href="#" class="easyui-linkbutton" onclick="addTab('easyui','http://jeasyui.com/')">easyui</a>
    </div>
    <div id="tt" class="easyui-tabs" style="400px;height:250px;">
    	<div title="Home">
    	</div>
    </div>
    

      addTab函数,最简单的示例,打通了多日的痛点

    function addTab(title, url){
    	if ($('#tt').tabs('exists', title)){
    		$('#tt').tabs('select', title);
    	} else {
    		var content = '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="100%;height:100%;"></iframe>';
    		$('#tt').tabs('add',{
    			title:title,
    			content:content,
    			closable:true
    		});
    	}
    }
    

      

  • 相关阅读:
    在WINDOWS任务计划程序下执行PHP文件 PHP定时功能的实现
    使用Sublime Text 3进行Markdown 编辑+实时预览
    ni_set()函数的使用 以及 post_max_size,upload_max_filesize的修改方法
    CORS跨域的概念与TP5的解决方案
    tp5模型笔记---多对多
    微信小程序 GMT+0800 (中国标准时间) WXSS 文件编译错误
    ESP8266 LUA脚本语言开发: 外设篇-GPIO输入检测
    ESP8266 LUA脚本语言开发: 外设篇-GPIO输出高低电平
    ESP8266 LUA脚本语言开发: 准备工作-LUA文件加载与变量调用
    ESP8266 LUA脚本语言开发: 准备工作-LUA开发说明
  • 原文地址:https://www.cnblogs.com/lrzy/p/8658411.html
Copyright © 2011-2022 走看看