摘要: --------------------css3选择器-------------------------css3属性选择器 ~~属性选择器基本上ie7+都支持,可以相对放心的使用 见: www.caniuse.com[attr][attr=value][attr*=value] //css3[attr^=value] //css3[attr$=value] //css3[attr~=value] ~~ [title~="foo2"] 匹配 可用[attr*=value]实现同等的选择效果[attr|=value] ~~ [lang|="en-us"] 匹 阅读全文
posted @ 2013-07-06 19:43 stephenykk 阅读(493) 评论(0) 推荐(0) 编辑
摘要: ~~·数组的length属性是可读写的var colors = ["blue","red","green"];colors.length = 2;alert(colors[2]);//undefined移除colors.length = 8;alert(colors[6]);//undefined新增colors[99] = "black";alert(colors.length);//100小结:数组的length属性不是只读的。将length的值设置小于当前长度,会删除后面的项;设置大于当前长度,会新 阅读全文
posted @ 2013-07-06 13:51 stephenykk 阅读(326) 评论(0) 推荐(0) 编辑
摘要: ~~~数组添加元素后一般返回数组的新长度 如: push(ele1[,ele2...]), unshift(ele1[,ele2...])~~~数组删除元素后一般返回被删除的元素 如: pop() , shift()var colors = new Array();var count = colors.push("red","green","black");alert(count); //3说明:push方法可以接收任意数量的参数,把它们逐个添加到数组末尾,并返回修改后数组的长度。var item = colors.pop();ale 阅读全文
posted @ 2013-07-06 13:39 stephenykk 阅读(456) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-07-06 12:28 stephenykk 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 在javascript中一共有四种调用模式:方法调用模式、函数调用模式、构造器调用模式和apply调用模式。这些模式在如何初始化关键参数this上存在差异方法调用模式 当一个函数被保存为对象的一个属性时,我们称之它为该对象的一个方法,那么this被绑定到该对象上。 复制代码 代码如下:var myObject={ name : "myObject" , value : 0 , increment : function(num){ this.value += typeof num === 'number' ? num : 0; } , toString : f 阅读全文
posted @ 2013-07-06 11:55 stephenykk 阅读(190) 评论(0) 推荐(0) 编辑