论坛回帖随手写
iteye_17153
这个作者很懒,什么都没留下…
展开
-
canvas圆与点的碰撞检测
text html,body{ margin:0; padding:0;} var Circle = function(){ this.x = 0; this.y = 0; this.radius = 50; this.z = 0; this.vx = 5; this.vy = 5; this.color = ...2011-11-01 10:42:22 · 212 阅读 · 0 评论 -
将数组头部的一个集合移动到数组末尾,不允许使用数组自带的方法
//将数组头部的一个集合移动到数组末尾,不允许使用数组自带的方法 //{1,2,3,4,5,6,7}=>{4,5,6,7,1,2,3} var arr = ['num-1','num-2','num-3','num-4','num-5','num-6','num-7']; function moveHeadCollectToEnd1(arr,pos){ for(var i=0;...原创 2011-11-04 10:43:52 · 157 阅读 · 0 评论 -
canvas模拟hover事件
[code="js"] Untitled Document html,body{ margin:0; padding:0;} 你的浏览器不支持canvas,狗日的IE。 var cvs = document.getElementById("cvs"); var ctx = cvs.getContext('2d'); if(ctx){ va...原创 2011-11-17 16:41:59 · 1905 阅读 · 0 评论 -
javascript获取get方式传参
[code="javascript"] (function(){ var get = window.$_GET = {}; var args = location.search.replace('?','').split('&'); for(var i=0,j=args.length,temp;i原创 2011-11-21 17:58:40 · 264 阅读 · 0 评论