(前端)工作总结 2

erp系统所涉及到的主要框架 ace admin 地址:http://ace.jeka.by/

  1. 右侧隐藏按钮
    (前端)工作总结 2_第1张图片
    .net 控件 控制一行显示4个,每个label属性display : inline-block 设置成固定宽度 80,外侧div设置min-width:140px 高度随label个数自动增加。注意:设置成table样式的话 checkbox 与 label文本产生高度差 不在同一个水平线上

2.图标部分
在这里插入图片描述
图标用的font awesome 4.5版本 地址 http://fontawesome.dashgame.com/
ui-icon ace-icon 产生放大效果

图标背景widget-header 样式background-image: linear-gradient(to bottom,#FFF 0,#EEE 100%);
3.表格部分:通过头部调用样式<%@ page language="C#" autoeventwireup="true" inherits="Customer_ScreenCusList, DHERP.Web" theme="Themes" enableEventValidation="false" %>
(前端)工作总结 2_第2张图片
html:

css:

.tbData
{
	border:solid 1px #ddd;
	/*border:solid 1px #ddd*/
	background:#ffffff;
	border-top:none;
	/*table-layout:fixed;
	behavior: url(../../Public/Script/dragtable.htc);*/
}

.tdHead1 th
{
   font-weight:normal;
   border:solid 1px #ddd
  background: rgb(255,255,255); /* Old browsers */
background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(231,235,251,1) 0%, rgba(204,214,248,1) 53%, rgba(239,242,253,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(231,235,251,1) 0%,rgba(204,214,248,1) 53%,rgba(239,242,253,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(231,235,251,1) 0%,rgba(204,214,248,1) 53%,rgba(239,242,253,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
   text-align:center;
   height:22px;
   line-height:22px;
   border-top:none;
   padding-left:5px;
   padding-right:5px;
   white-space:nowrap;
   /*overflow:hidden;
   text-overflow:ellipsis;        /* for IE */
	/*-o-text-overflow: ellipsis;     for Opera */
   
}
.tdRow1 td
{
	padding-left:5px;
	padding-right:15px;
	border:solid 1px #ddd
	height:20px;
    line-height:20px;
	white-space:nowrap;
	/*overflow:hidden;
    text-overflow:ellipsis;        /* for IE */
	/*-o-text-overflow: ellipsis;     for Opera */
}
/*隔行换色 */
table tr:nth-child(2n)
{
	/*浅紫色*/
	background-color: #EFEDF5;
	
}
/*悬停变色*/
.tbData>tbody>tr:hover
{
  background-color: #dddfff;	
}

4.复选框样式重写
新写一个复选框覆盖原来的样式(参考ace admin的复选框)。

/*//checkBox样式设置*/

input[type=checkbox],
input[type=radio] {
	position: relative;
	display: inline-block;
	margin-right: 5px;
	line-height: 20px;
/*	min-height: 14px;
*/	min-width: 14px;
	font-weight: 400;
	cursor: pointer
}


input[type=checkbox]::before {
	cursor: pointer;
	font-family: fontAwesome;
	font-weight: 400;
	font-size: 12px;
	color: #FFF;
	content: "\a0";
	background-color: #FAFAFA;
	border: 1px solid #C8C8C8;
	
	border-radius: 0;
	display: inline-block;
	text-align: center;
	height: 14px;
	line-height: 14px;
	min-width: 14px;
	position: relative;
	top: -2px
}


input[type=checkbox]:checked::before {
	display: inline-block;
	content: '\f00c';
	background-color: #F9A021;
	border-color: #F9A021;
	color: #FFF
}

input[type=checkbox]:hover::before {
	border-color: #FF893C
}

input[type=checkbox]:focus::before {
	border-color: #F59942
}

input[type=checkbox]:active::before {
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05), inset 0 1px 3px rgba(0, 0, 0, .1)
}

input[type=checkbox]:disabled::before {
	background-color: #DDD!important;
	border-color: #CCC!important;
	box-shadow: none!important;
	color: #BBB
}
input[type=checkbox]:checked::after {
	font-family: FontAwesome;
	font-size: 14px;
	line-height: 14px;
	content: "\a0";
	top: -1px;
	text-shadow: none;
	padding: 0;
	text-align: center;
	color: #BBB;
	letter-spacing: 0
}
input[type=checkbox]#cball:checked::before {
	display: inline-block;
	content: '\f00c';
	background-color: #fff;
	border-color: #2283C5;
	color: #2283C5
}
input[type=checkbox]#cball:hover::before {
	border-color: #2283C5;
	}
.tdRow1>td>input[type=checkbox]:checked::before {
	display: inline-block;
	content: '\f00c';
	background-color: #fff;
	border-color: #2283C5;
	color: #2283C5
}
.tdRow1>td>input[type=checkbox]:hover::before {
	border-color: #2283C5;
	}	

此处需要引用

  1. 选项卡左右调节按钮
    在这里插入图片描述
    思路: 将 包含选项卡的div 设置成绝对定位 position:absolute ;left:0; 固定宽度 800px; 当选卡超过宽度时隐藏 overflow:hidden; 为按钮附加点击事件每点击向右或向左移动100px。

JS:位置 …/Public/h-ui.admin/js/H-ui.admin.js

  //横向移动选项卡标题
  $('#js-tabNav-next').click(function(){
  	num==oUl.find('li').length-1?num=oUl.find('li').length-1:num++;
  	toNavPos();
  });
  $('#js-tabNav-prev').click(function(){
  	num==0?num=0:num--;
  	toNavPos();
  });
  //横向移动tab下部分选项卡标题
  $('#js-tabNav-next1').click(function(){
  	num==$("#recent-tab").find('li').length-1?num=$("#recent-tab").find('li').length-1:num++;
  	toNavPos1();
  });
  $('#js-tabNav-prev1').click(function(){
  	num==0?num=0:num--;
  	toNavPos1();
  });
  function toNavPos(){
  	oUl.stop().animate({'left':-num*100},100);
  }
  function toNavPos1(){
  	$("#recent-tab").stop().animate({'left':-num*100},100);
  }

HTML:

 

6:最小化,最大化按钮部分 以及左,右上,右下三栏高度控制:
(前端)工作总结 2_第3张图片
JS:将table 表格高度设为定高, 获取浏览器高度,通过一系列 计算 算出右下框的高度 使得和左边边框始终对齐。

//三栏高度控制
//调整窗口为默认大小

function changred() {
	var winHeight = 0;
	if(window.innerHeight) winHeight = window.innerHeight;
	else if((document.body) && (document.body.clientHeight)) winHeight = document.body.clientHeight;
	//通过深入Document内部对body进行检测,获取浏览器窗口高度
	if(document.documentElement && document.documentElement.clientHeight) winHeight = document.documentElement.clientHeight;
	var treeheight = winHeight - 6;

	document.getElementById("tree-style").style.height = treeheight - 60 + "px";
	document.getElementById("tree-box").style.height = treeheight + "px";
	document.getElementById("max-box").style.height = treeheight + "px";
	document.getElementById("widget-body-tab").style.display = "block";
	document.getElementById("widget-body-table").style.display = "block";
	document.getElementById("page1").style.display = "block";
	document.getElementById("widget-body-table").style.height = "460px";
	var tabheight = treeheight - 578;
	if(tabheight > 0) {
		document.getElementById("widget-body-tab").style.height = treeheight - 578 + "px";
	} else {
		document.getElementById("widget-body-tab").style.display = "none";
	}

	document.getElementById("res").style.display = "none";
	document.getElementById("max").style.display = "inline";
	document.getElementById("min").style.display = "inline";

	var h = document.getElementsByClassName("tab-table");
	for(var i = 0; i < h.length; i++) {
		h[i].style.height = "230px";
	}
	document.getElementById("tab-box").style.border = 1;
	document.getElementById("hfListSize1").value = "17";
	document.getElementById("hfListSize2").value = "6";
	document.getElementById("btnClr").click();
}
//点击最大化按钮
function changmax() {
	var winHeight = 0;
	if(window.innerHeight) winHeight = window.innerHeight;
	else if((document.body) && (document.body.clientHeight)) winHeight = document.body.clientHeight;
	//通过深入Document内部对body进行检测,获取浏览器窗口高度
	if(document.documentElement && document.documentElement.clientHeight) winHeight = document.documentElement.clientHeight;
	document.getElementById("widget-body-tab").style.display = "block";
	document.getElementById("page1").style.display = "none";
	document.getElementById("widget-body-table").style.display = "none";
	document.getElementById("widget-body-tab").style.height = winHeight - 84 + "px";
	document.getElementById("res").style.display = "inline";
	document.getElementById("max").style.display = "none";
	document.getElementById("min").style.display = "inline";
	var h = document.getElementsByClassName("tab-table");
	for(var i = 0; i < h.length; i++) {
		h[i].style.height = "100%";
	}
	document.getElementById("hfListSize1").value = "0";
	document.getElementById("hfListSize2").value = "33";
	document.getElementById("btnClr").click();
}
//点击最小化按钮
function changmin() {
	var winHeight = 0;
	if(window.innerHeight) winHeight = window.innerHeight;
	else if((document.body) && (document.body.clientHeight)) winHeight = document.body.clientHeight;
	//通过深入Document内部对body进行检测,获取浏览器窗口高度
	if(document.documentElement && document.documentElement.clientHeight) winHeight = document.documentElement.clientHeight;
	document.getElementById("widget-body-table").style.display = "block";
	document.getElementById("widget-body-tab").style.display = "none";
	document.getElementById("page1").style.display = "block";
	document.getElementById("widget-body-table").style.height = winHeight - 126 + "px";
	document.getElementById("res").style.display = "inline";
	document.getElementById("max").style.display = "inline";
	document.getElementById("min").style.display = "none";

	var listnum = parseInt((winHeight -170) / 24);
	document.getElementById("hfListSize1").value = listnum;
	document.getElementById("hfListSize2").value = "0";
	document.getElementById("btnClr").click();

}

HTML:

   
        
      	 
         
	 

7: ace选项卡部分:基于bootstrap 框架 所以需要引用bootstrap.min.js
HTML:

CSS:引用 ace.min.css 以及bootstrap.min.css

8:手风琴部分:
(前端)工作总结 2_第4张图片
HTML:


JS:调用 ace.min.js 以及 bootstrap.min.js ;
暂时写到这以后待补充。。。
1.(补充部分)选项卡插件:

			
					

(前端)工作总结 2_第5张图片
选项卡在左侧

	

(前端)工作总结 2_第6张图片
选项卡在右侧

(前端)工作总结 2_第7张图片
手风琴插件代码

 

(前端)工作总结 2_第8张图片
ace admin 框架真的很不错 喜欢的可以去下载源码,网上也有文档虽然不是很易读。

你可能感兴趣的:(css,前端)