Skip to content

Instantly share code, notes, and snippets.

@turbotree
turbotree / 点击一个body隐藏块
Created August 13, 2014 11:08
点击一个body隐藏块
var run = true;
function aa(){
run = false;
}
$("body").click(function(){
if(run){
$("#cancel").hide();
$("#fahuo").hide();
@turbotree
turbotree / 垂直居中
Created September 5, 2014 03:48
CSS垂直水平完全居中手册
它是一行的吗?
  有时侯元素可以表现像垂直居中,只是因为它们有相等的上下padding
  
  
  .link {
padding-top: 30px;
padding-bottom: 30px;
}
@turbotree
turbotree / 详情
Created September 9, 2014 02:43
汉字所占字节与编码方式有关
public static void main(String []args) throws UnsupportedEncodingException {
// 运行结果:2
System.out.println("柳峰".getBytes("ISO8859-1").length);
// 运行结果:4
System.out.println("柳峰".getBytes("GB2312").length);
// 运行结果:4
System.out.println("柳峰".getBytes("GBK").length);
// 运行结果:6
System.out.println("柳峰".getBytes("UTF-8").length);
}