上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 23 下一页
摘要: var pattern1 = /好/g;console.log(pattern1.test("你好"));字符串查找:var pattern1 = /\w/;console.log(pattern1.test("njkhjkjk"));空格查找:var pattern1 = /\s/;console... 阅读全文
posted @ 2015-03-28 11:07 唸随爱 阅读(1023) 评论(0) 推荐(0) 编辑
摘要: var c=[2,4,3,5,2,2,2], a = {}, i = 0; for(;i<c.length;i++){ a[c[i]] = 1 //利用对象名称不能重复的特性来去重 } c=[]; for(var g in a){ c.push(g-0); } conso... 阅读全文
posted @ 2015-03-28 10:52 唸随爱 阅读(237) 评论(0) 推荐(0) 编辑
摘要: var a = function(a,b){ console.log(a+b);},b = { c:5, d:3};a.call(b,1,2);a.apply(b,[1,2]);a.call(b,b.c,b.d);a.call(b,this.c,this.d); 阅读全文
posted @ 2015-03-14 15:24 唸随爱 阅读(125) 评论(0) 推荐(0) 编辑
摘要: var a = [2,3,4,5],c = Math.max.apply(null,a);console.log(c);console.log(Math.max.apply(null,[3,8,44,48]));console.log(Math.max.call(null,3,8,44,48));当... 阅读全文
posted @ 2015-03-14 15:14 唸随爱 阅读(169) 评论(0) 推荐(0) 编辑
摘要: var ary = [8,9,10,3], compare = function(a,b){ return b.age-a.age; }, g = [ { name:"jim", age:29 }, { name:"tom", age:15 ... 阅读全文
posted @ 2015-03-14 14:51 唸随爱 阅读(111) 评论(0) 推荐(0) 编辑
摘要: function a(){ console.log(arguments.length); var c = [].slice.call(arguments);//类数组转成数组 c.push(5); console.log(c); console.log(arguments);}a(1,2,3)var... 阅读全文
posted @ 2015-03-14 14:49 唸随爱 阅读(521) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2015-03-14 11:28 唸随爱 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 实现方法: (1)利用canvas画布,fillRect()描绘出一个矩形(不是透明),定位盖在某个标签如div上面(这个标签写着中奖的信息) (2)globalCompositeOperation = 'destination-out';利用此属性,手指划过画布,arc(x,y, radius... 阅读全文
posted @ 2015-03-02 16:21 唸随爱 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 如图所示,Tag标签的制作通常使用背景图片,现在用CSS3代码就能实现尖角效果(需浏览器支持CSS3属性).运用CSS3样式实现尖角标签,只需要写简单的HTML结构和CSS样式. Tag1 Tag2 Tag3 Tag4css主要利用伪元素来实现尖角a{ dispaly:... 阅读全文
posted @ 2015-03-02 15:55 唸随爱 阅读(419) 评论(0) 推荐(0) 编辑
摘要: 公历 年 月 ... 阅读全文
posted @ 2015-03-02 15:38 唸随爱 阅读(776) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 23 下一页