会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
hutaotaotao
博客园
首页
新随笔
联系
订阅
管理
2015年6月27日
关于e.preventDefault() 阻止默认行为 对登陆框限制输入的解决方法
摘要: 当登陆框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
阅读(1211)
评论(0)
推荐(0)
2015年6月26日
javascript跨浏览器事件绑定
摘要: //跨浏览器事件绑定function addEvent(obj,type,fn){//obj目标对象, type事件类型 注意是:"load" ,fn函数回调if (typeof obj.addEventListener !="undefined"){ //W3C方法obj.addEventList...
阅读全文
posted @ 2015-06-26 21:00 hutaotaotao
阅读(166)
评论(0)
推荐(0)
2015年6月10日
《匿名函数和闭包》 李炎恢老师视频摘记
摘要: 1 //普通函数 2 function box(){ //函数名称 3 return "LEE"; 4 }; 5 alert(box()); //执行 6 7 -----------------------------------------------...
阅读全文
posted @ 2015-06-10 13:22 hutaotaotao
阅读(232)
评论(0)
推荐(0)
通过offsetTop函数获取层叠Div的偏移量
摘要: 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
阅读(413)
评论(0)
推荐(0)
公告