摘要: 当登陆框div内的length 为0时,执行e.preventDefault()//删除左后空格function trim(str){ return str.replace(/(^\s*)|(\s*$)/g,'');} if (trim(this.innerHTML).lengt... 阅读全文
posted @ 2015-06-27 21:30 hutaotaotao 阅读(1181) 评论(0) 推荐(0) 编辑
摘要: //跨浏览器事件绑定function addEvent(obj,type,fn){//obj目标对象, type事件类型 注意是:"load" ,fn函数回调if (typeof obj.addEventListener !="undefined"){ //W3C方法obj.addEventList... 阅读全文
posted @ 2015-06-26 21:00 hutaotaotao 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 1 //普通函数 2 function box(){ //函数名称 3 return "LEE"; 4 }; 5 alert(box()); //执行 6 7 -----------------------------------------------... 阅读全文
posted @ 2015-06-10 13:22 hutaotaotao 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 1 window.onload=function(){ 2 var box=document.getElementById("box"); 3 //alert(box.offsetTop); //margin:20px; 4 //alert(box.offsetParen... 阅读全文
posted @ 2015-06-10 13:19 hutaotaotao 阅读(389) 评论(0) 推荐(0) 编辑