摘要: 1 html, address, 2 blockquote, 3 body, dd, div, 4 dl, dt, fieldset, form, 5 frame, frameset, 6 h1, h2, h3, h4, 7 h5, h6, noframes, 8 o... 阅读全文
posted @ 2015-07-16 22:03 liu玙 阅读(495) 评论(0) 推荐(0) 编辑
摘要: 1.1 Array.prototype.unique = Array.prototype.unique || function (){2 var arr = [];3 for (var i = 0,len = this.length; i < len; i++){4... 阅读全文
posted @ 2015-07-16 16:14 liu玙 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1.冒泡排序 1 Array.prototype.specialSort = function(){ 2 //冒泡排序 3 var len = this.length, 4 a = 0; 5 for(var i = 0; i this[j+1... 阅读全文
posted @ 2015-07-13 22:28 liu玙 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1 function clone(obj) { 2 var buf; 3 if(obj instanceof Array){ //被克隆的对象是数组 4 buf = []; 5 var i = obj.length;... 阅读全文
posted @ 2015-07-12 13:18 liu玙 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 1.传入一个string类型的参数,然后将string的每个字符间加个空格返回1 String.prototype.spacify = function(){2 return this.split("").join(" ");3 };4 console.log("ab... 阅读全文
posted @ 2015-07-11 22:47 liu玙 阅读(160) 评论(0) 推荐(0) 编辑
摘要: var user ="THE WINDOW";window.onload = function(){ var user = "The window"; var object = { user: "the person", getUserFunc: functi... 阅读全文
posted @ 2015-07-05 10:30 liu玙 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 1 var createXHR=function(){ 2 if(typeof XMLHttpRequest!="undefined"){ 3 return new XMLHttpRequest(); 4 }else if(typeof ActiveXO... 阅读全文
posted @ 2015-06-11 16:39 liu玙 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 1 //为Object.prototype增加method方法,下次为对象添加方法不必键入prototype 2 Object.prototype.method=function(name,func){ 3 if(!this.prototype[name]){ 4 ... 阅读全文
posted @ 2015-05-25 16:40 liu玙 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 创建一个绝对定位的元素,使其可以用鼠标移动。下面分别是HTML、CSS、JavaScript部分 1 2 3 拖拽 4 内容 5 6 7 /////////////CSS//////////////////////// 8 #dragga... 阅读全文
posted @ 2015-04-28 16:45 liu玙 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1 var EventUtil={ 2 addHandler:function(element,type,handler){ //为元素添加事件处理程序 3 if(typeof element.addEventListener=="function"){ ... 阅读全文
posted @ 2015-04-19 10:57 liu玙 阅读(147) 评论(0) 推荐(0) 编辑