css reset
/*-----------------css reset-----------------*/
dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td,body,div{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
ol,ul{list-style:none;}
fieldset,img{border:0;}
textarea{resize:none;}
input:focus,textarea:focus{outline:none;}
a{text-decoration:none;}
a:hover{text-decoration:underline;}
p:before,p:after{content:'';}/*去掉被引用内容的引号*/
abbr,acronym{border:0;font-variant:normal;}/*网页中的文字缩写与简称设置为正常字体*/
address,cite,dfn,optgroup,em,var{font-style:normal;}
legend{color:#000;}
.clear{clear:both;height:0;overflow:hidden;}
.cf:after{visibility:hidden;display:block;font-size:0;content:"";clear:both;height:0;}
*.cf{zoom:1;}
font-family中英对照
宋体SimSun 黑体 SimHei 微软雅黑 Microsoft YaHei 微软正黑体 Microsoft JhengHei
新宋体 NSimSun 新细明体 PMingLiU 细明体 MingLiU 标楷体 DFKai-SB
仿宋 FangSong 楷体 KaiTi 仿宋_GB2312 FangSong_GB2312 楷体_GB2312 KaiTi_GB2312
<meta http-equiv="X-UA-Compatible" content="IE=edge">
jq远程引用地址
百度的引用地址:
<script typet="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
新浪的引用地址:
<script typet="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
360的引用地址:
<script typet="text/javascript" src="http://libs.useso.com/js/jquery/1.9.1/jquery.min.js"></script>
// 事件处理对象,调用方法:eventUtility.addHandler(element,type,函数名)。
var eventUtility = {
addHandler:function(element,type,handler){
if (element.addEventListener) {
element.addEventListener(type,handler);
}else if(element.attachEvent){
element.attachEvent('on'+type,handler);
}else{
element['on'+type] = handler;
};
},
removeHandler:function(element,type,handler){
if (element.addEventListener) {
element.removeEventListener(type,handler);
}else if(element.attachEvent){
element.detachEvent('on'+type,handler);
}else{
element['on'+type] = null;
};
},
getType:function(event){
return event.type;
},
getElement:function(event){
return event.target || event.srcElement;
},
//获取事件对象
getEvent:function(event){
return event?event:window.event;
},
//阻止事件,默认行为
preventDefault:function(event){
if (event.preventDefault) {
event.preventDefault();
}else{
event.returnValue = false;
};
},
//阻止事件冒泡
stopPropagation:function(event){
if (event.stopPropagation) {
event.stopPropagation();
}else{
event.cancelBubble = true;
};
}
}