Sai


disconnected
主题工具

[JS] 一段有趣的代码……

... 发表于 2006-10-11 13:13  ... 16544 次点击

只需要直接在浏览器的地址栏里输入一段简单的JavaScript代码即可让网页上的图片都绕成圈在旋转……

附代码:(大家也来试试,很好玩的^_^)
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5); void(0);


本主题共有 4 条回复 | 回到顶部
#1 - 2006-11-25 11:56
now 地球
试过了,玩玩用哦。
#2 - 2007-8-13 12:21
isncn 地球
如何能让他转的慢一点啊,头晕
#3 - 2007-8-14 00:23
Leon 地球
这个我来解答,慢一点就这样改:
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',30); void(0);

郭鑫 from discuz.net
#4 - 2007-8-18 18:23
v3v3v3v3 地球
呵呵~~有越点越快的倾向哦~
看完之后有话想说?那就帮楼主加盖一层吧!

在回复之前你需要先进行登录
用户名 / UID
密码
Project Parasynthesis | Based on Discuz! 5.5.0 | Thanks to Livid
About | Help | Developer | N2Design
清除 Cookies - 联系我们 - 无名杂志 - Archiver - Mobile
Processed in 0.047480 second(s), 6 queries, Gzip enabled