JS 获取时间戳
1 |
var timestamp=new Date().getTime(); |
人生没有原因,闯出一路精彩
1 |
var timestamp=new Date().getTime(); |
http://barcode-coder.com/en/barcode-jquery-plugin-201.h […]
1 |
<a href="#the_id"></a> |
1 2 3 4 5 6 7 8 9 10 11 |
// 方法一,IE6,IE8,FireFox,Chrome 测试通过 document.getElementById("the_id").scrollIntoView(); // 方法二,IE6,IE8,FireFox测试通过, Chrome貌似第一次行, 再一次好像不行 window.location.hash = "#the_id"; // 方法三, jq实现,没试 var _targetTop = $('#the_id').offset().top;//获取位置 jQuery("html,body").animate({scrollTop:_targetTop},1000);//跳转 $("html,body").animate({scrollTop: $("#the_id").offset().top}, 1000)//合成一句完成 |
1 2 3 4 5 6 7 8 9 10 11 |
var the_ele = document.getElementById("the_id"); // 非IE, 注意逗号后有空格,即140前面有空格 if(the_ele .style.color == "rgb(255, 140, 0)"){ // your code here } // IE6-8, 注意a-f的十六进制要小写 if(the_ele .style.color == "#ff8c00"){ // your code here } |
1 2 3 4 5 6 7 8 9 10 11 12 |
// 创建 $arr = array(); $arr = array("abc","def","kkk");// 省略了key,默认为整数键,从0开始,以1递增 $arr = array("allen"=>"abc", "peter"=>"def","keven"=>"kkk");//带key, 可用$arr["allen"]取值 // 判断 in_array($value, $arr); // 是否包含指定值,最慢 array_key_exists($key, $arr); // 是否包含指定key, 快 isset($arr[$key]);//是否存在, 最快 // 计算数组中的元素数目或对象中的属性个数 count($arr); |
3个判断函数的性能参考:http://mae […]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
//创建: var arr = new Array(); var arr = new Array("abc", "def", 1, 5, 9); var arr = ["abc", "def", 1, 5, 9]; //遍历: for (i in arr){ alert("value=" + arr[i]); } |
判断数组是否包含指定元素时,网上的一个方法是 […]
Sublime text 3是我最喜欢的代码编辑器,每天和代码打交道,必先利其器,掌握基本的代码编辑器的快捷键 […]
html table 隐藏td 可用:
1 |
style="display:none;" |
用下 […]
1 2 3 4 5 6 7 |
$today = date("Y-m-d");//今天 $firstDay = date("Y-m-01", strtotime($today));//本月第一天 $lastDay = date("Y-m-t", strtotime($today));//本月最后一天 $last = strtotime("-1 month", time());//上个月的今天 $lastFirstDay = date("Y-m-01", strtotime($last));//上个月第一天 $lastLastDay = date("Y-m-t", strtotime($last));//上个月最后一天 |
这里计算本月最后一天,用的”t& […]
/etc/skel下所有文件会在创建新用户时复制到对应的home下 参考:http://m.blog.csdn […]
1 |
mkdir -pv abc/def/kkk |
该命令会逐级创建3个文件夹, […]
一 权限掩码umask umask是chmod配套的,总共为4位(gid/uid,属主,组权,其它用户的权限) […]
Locale是某一个地域内的人们的语言习惯和文化传统和生活习惯,是根据计算机用户所使用的语言,所在国家或者地区 […]