摘要: 在《javascript高级程序设计》一书的6.3.5:创建和操作节点一节中,介绍了几种动态创建html节点的方法,其中有以下几种常见方法:· crateAttribute(name): 用指定名称name创建特性节点· createComment(text): 创建带文本t... 阅读全文
posted @ 2015-01-28 19:15 justlancer 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 实现iframe可编辑用到 document.designMode='on'(允许编辑)1.清空代码2.frames :获取给定文档定义或与给定窗口关联的文档定义的所有 window 对象的集合(取得window对象集合)清空输出代码var_frame=document.getElementById... 阅读全文
posted @ 2015-01-28 11:42 justlancer 阅读(470) 评论(0) 推荐(0) 编辑
摘要: 似乎是Jquery的一个Bug,因为一般来说,在任何情况下都不应该重复触发onload事件。重现Bug的代码如下:$(function(){ $("#test").append('');})百般百度无果,最终在StackOverFlow上找到了同样的问题:http://stackoverfl... 阅读全文
posted @ 2015-01-27 15:38 justlancer 阅读(2568) 评论(0) 推荐(0) 编辑
摘要: var ShareTip = function(){}//分享到腾讯微博ShareTip.prototype.sharetoqq=function(content,url,picurl){var shareqqstring='http://v.t.qq.com/share/share.php?tit... 阅读全文
posted @ 2015-01-26 17:46 justlancer 阅读(242) 评论(0) 推荐(0) 编辑
摘要: obj.clientWidth //获取元素的宽度obj.clientHeight //元素的高度obj.offsetLeft //元素相对于父元素的leftobj.offsetTop //元素相对于父元素的topobj.offsetWidth //元素的宽度obj.offsetHeight //元... 阅读全文
posted @ 2014-10-30 17:11 justlancer 阅读(2774) 评论(0) 推荐(0) 编辑
摘要: var url = location.pathname; var nav = $('.head .nav li > a'); var reg = /^\/\d*$/; if(url=='/'||reg.test(url)){ nav.eq(0).addClass('curren... 阅读全文
posted @ 2014-10-20 16:02 justlancer 阅读(789) 评论(0) 推荐(0) 编辑
摘要: Chrome 27之后,正式取消了-webkit-text-size-adjust属性,所有字号最小为12px。目前似乎只有通过类似 transform:scale(0.875); 的方式来解决,但效果貌似并不是很理想。 阅读全文
posted @ 2014-10-18 11:47 justlancer 阅读(284) 评论(0) 推荐(0) 编辑
摘要: Shortcut Icon地址栏显示图标2010-12-22 22:08:57标签:shortcut icon favicon.ico休闲生活职场Shortcut Icon 就是在网站地址的前面出现的那个小图标。 想要让你的网站显示个性图标,首先需要制作个icon的图标(用PS自己做或者用在线的制作... 阅读全文
posted @ 2014-10-15 14:50 justlancer 阅读(513) 评论(0) 推荐(0) 编辑
摘要: if (!document.addEventListener) { // IE6~IE8 document.write(''); } 阅读全文
posted @ 2014-09-12 20:01 justlancer 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2012-09-25 16:34 justlancer 阅读(369) 评论(0) 推荐(0) 编辑