常用的css和js

css

input:-ms-input-placeholder,
textarea:-ms-input-placeholder {  color: #666;}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {  color: #666;};

-------------------------------------小三角:
.main_wrap_icon{
	position:absolute;
	top:50%;
	left:-20px;
	margin-top:-18px;
	display:inline-block;
	0;
	height:0;
	border-top:16px solid transparent;
	border-left:16px solid #00a76d;
	border-bottom:16px solid transparent;
}


t弹层高度
var winH=$(window).height();
var  bodyH=$('body').height();
if(bodyH>winH){
	$('.layer_box').height(bodyH);
	}
常用的序号1,2,3,。。。
.readme dl.counter dd p:after {
  content: counter(section) "、";
  counter-increment: section;
  position: absolute;
  left: -1.5em;
  top: 0;
}

-------------------------------------上下箭头

.readme dt:after {
  border-top-color: #fff;
  margin-top: -2px;
}
.readme dt:after, .readme dt:before {
  content: "";
  position: absolute;
   0;
  height: 0;
  border: transparent solid 0.45em;
  border-top: #666 solid .45em;
  right: 1em;
  top: 1.3em;
}
/////////
.readme dl.unfold dt:after, .readme dl.unfold dt:before {
  border-top: none;
  border-bottom: #ff444b solid .45em;
}
.readme dt:after, .readme dt:before {
  content: "";
  position: absolute;
   0;
  height: 0;
  border: transparent solid 0.45em;
  border-top: #666 solid .45em;
  right: 1em;
  top: 1.3em;
}

  js代码

 
//ie8圆角
			$(function() {
				if(window.PIE) {
					$('.rounded').each(function() {
						PIE.attach(this);
					});
				} 
//设置偶数行和奇数行
 $("tbody>tr:odd").addClass("ou");   //为奇数行设置样式(添加样式类)
 $("tbody>tr:even").addClass("dan");  // 为偶数行设置样式类
 $("tbody>tr:has(:checked)").addClass("ed");   //判断行是否被选中(返回布尔类型)添加样式类   // has(:checked)")   返回一个bool值  true/false

 // 搜索被选中 has(:checked)
 $('tbody>tr').click(function(){
  var hased = $(this).hasClass('ed');
//tab
//我的佣金的明细
		$('.detailed_con ul li:even').css('background','#f7f9fc');
		$('.detailed_tab span').click(function(){
			$(this).addClass('active').siblings().removeClass('active');
			$('.detailed_con ul').eq($(this).index()).show().siblings().hide();
		});
/*页面注释的隐藏效果*/
		$('.notes').click(function(){
			$(this).slideUp(500);
			});
		//计算弹层高度
		var winH = $(document).height();
		var boxH = $('body').height();
		if(winH > boxH){
			$('.layer').height(winH);
		}else{
			$('.layer').height(boxH);
		}
//浮动按钮的效果和阻止冒泡
		$('.btn_floating_button').click(function(){
			$(this).hide();
			$('.floating_container').show();
			event.stopPropagation();
			});
//search框的搜索
		$('.search').focus(function(){
			$('.icon_search_close').show();
		});
		$('.icon_search_close').click(function(){
			$('.search').val('');
			})
//search默认值
 $('#inputSearch').focus(function() {
    $(this).addClass('focus');
		if($(this).val()==this.defaultValue){
			$(this).val('');
			}
	 }).blur(function(e) {
    $(this).removeClass('focus');
		if($(this).val()==''){
			$(this).val(this.defaultValue)
			}
	 }).keyup(function(e) {
    if(e.which==13){
			alert('回车提交表单!')
			}
  })
//each的方法
<script type="text/javascript">
			数组中的each
			 var arr=["one","two","three","four"]
			 $.each(arr,function(){
			 	alert(this);
			 });
			 //上面这个each输出的结果分别为:one,two,three,four
			 var arr1 = [[1, 4, 3], [4, 6, 6], [7, 20, 9]]       
				$.each(arr1,function(i,item){
					alert(item[1]);  
				});
			//其实arr1为一个二维数组,item相当于取每一个一维数组,   
			//item[0]相对于取每一个一维数组里的第一个值   
			//所以上面这个each输出分别为:1   4   7  
			var obj={one:1,two:2,three:3,four:4};
			$.each(obj,function(i){
				alert(obj[i])
			})
			//这个each就有更厉害了,能循环每一个属性     
//each在input按钮中使用情况
$.each($("input:hidden"), function(i,val){
alert(val); //输出[object HTMLInputElement],因为它是一个表单元素。
alert(i); //输出索引为0,1,2,3
alert(val.name); //输出name的值
alert(val.value); //输出value的值
}); 























//输出结果为:1   2  3  4 
		</script>

  

原文地址:https://www.cnblogs.com/gongxiaoyan/p/9414394.html