02 2014 档案

摘要:location对象location.href-- 返回或设置当前文档的URLlocation.search -- 返回URL中的查询字符串部分。例如 http://www.dreamdu.com/dreamdu.php?id=5&name=dreamdu 返回包括(?)后面的内容?id=5&name=dreamdulocation.hash -- 返回URL#后面的内容,如果没有#,返回空location.host -- 返回URL中的域名部分,例如www.dreamdu.comlocation.hostname -- 返回URL中的主域名部分,例如dreamdu.comoc 阅读全文
posted @ 2014-02-25 14:22 leejersey 阅读(4436) 评论(0) 推荐(0) 编辑
摘要:location.hash-- 返回URL#后面的内容,如果没有#,返回空hash,中文"哈希"引用网址:http://www.dreamdu.com/javascript/location.hash/兼容IE6+浏览器hash属性语法location.hash;hash属性图示hash属性说明域名中#号后面的部分通常是指定位置的链接的方式产生的,例如:ASCII编码-控制字符上面这个链接会直接定位到http://www.dreamdu.com/xhtml/ascii/文档中id为control_characters的标签处。示例document.writeln(locat 阅读全文
posted @ 2014-02-25 13:55 leejersey 阅读(6064) 评论(0) 推荐(0) 编辑
摘要:byzhangxinxufromhttp://www.zhangxinxu.com本文地址:http://www.zhangxinxu.com/wordpress/?p=1294一、前言碎碎念我从来对iframe就没有什么好感,对其基本上是不屑一顾。但是人在江湖,身不由己。经理发话,新功能使用iframe实现,没办法,只好折腾,两大烦人的东西,一是带遮罩的弹框提示,而是iframe高度问题。前一个烦人的问题使用其他形式的提示来规避,后一人扰人的问题确实没有什么经验,花了点时间折腾了下,基本上实现了效果,跨域没问题,兼容性也没问题,于是,写个小文备忘下,下次再使用的时候就到这儿拷贝核心代码。口碑 阅读全文
posted @ 2014-02-16 15:11 leejersey 阅读(3301) 评论(0) 推荐(0) 编辑
摘要:1.什么是闭包?函数嵌套函数,内部函数可以引用外部函数的参数和变量,参数和变量不会被垃圾回收机制所收回 function aaa(a){ var b = 5; function bbb(){ alert(a); alert(b); }}aaa();//JS中的垃圾回收机制function aaa(){ var a = 1; }aaa();function aaa(){ var a = 5; function bbb(){ alert(a); } return bbb;}var c =... 阅读全文
posted @ 2014-02-15 21:41 leejersey 阅读(5219) 评论(1) 推荐(0) 编辑
摘要://获取元素的样式值。function getStyle(elem, name) { if (elem.style[name]) { return elem.style[name]; } else if (elem.currentStyle) { return elem.currentStyle[name]; } else if (document.defaultView && document.defaultView.getComputedStyle) { name = name.replace(/([A-Z])/g, "-$1")... 阅读全文
posted @ 2014-02-13 16:09 leejersey 阅读(982) 评论(0) 推荐(0) 编辑
摘要:jQuery on()方法是官方推荐的绑定事件的一个方法。$(selector).on(event,childSelector,data,function,map)由此扩展开来的几个以前常见的方法有.bind() $("p").bind("click",function(){ alert("The paragraph was clicked."); }); $("p").on("click",function(){ alert("The paragraph was clicked.&q 阅读全文
posted @ 2014-02-12 09:30 leejersey 阅读(223427) 评论(7) 推荐(36) 编辑
摘要:很多时候会碰到那个的表单一般我们做文字提醒功能时会在value处直接写上,现在总结一个比较好的方法直接上代码:html: 微博/博客/邮箱/手机号 请输入密码 下次自动登陆 忘记密码 立即注册 CSS.login_cont dd {ma... 阅读全文
posted @ 2014-02-09 17:26 leejersey 阅读(5745) 评论(0) 推荐(0) 编辑
摘要:标题栏新消息提示如图:公司的项目中用到了这个新消息提示的效果,主要用于提示用户有新消息。具体实现代码如下:var newMessageRemind={_step: 0,_title: document.title,_timer: null,//显示新消息提示show:function(){var temps = newMessageRemind._title.replace("【 】", "").replace("【新消息】", "");newMessageRemind._timer = setTimeout(fu 阅读全文
posted @ 2014-02-01 21:05 leejersey 阅读(852) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示