网络新手
Would you like to react to this message? Create an account in a few clicks or log in to continue.
网络新手

原域名www.351.hag.cn已经改为www.wlxs.888ubb.net,请大家牢记!


您没有登录。 请登录注册

漂亮的烟花特效代码

向下  留言 [第1页/共1页]

1漂亮的烟花特效代码 Empty 漂亮的烟花特效代码 周日 五月 23, 2010 5:20 pm

tianxia


书童

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>漂亮的烟花,网络新手收集。</title>
<style type="text/css">
html,body { height:100%;}
body { background:#000; color:#FF0000; overflow:hidden;}
.divs { position:absolute; width:20px; height:20px;}
</style>
</head>
<body>

<script type="text/javascript">
var getRondom = function(small,big){
return small+(big-small)*Math.random();
}
var $ = function(id){ return document.getElementById(id);}
function circle(){
c=document.createElement('div');
c.innerHTML="*";
c.style.position ='absolute';
c.style.left = getRondom(200,window.screen.availWidth-200)+'px';
c.style.top = window.screen.availHeight-200 +'px';
document.body.appendChild(c);
h1 = getRondom(20,window.screen.availHeight-200);
h=window.screen.availHeight ;
t1 = setInterval(function(){h=h-10;c.style.top=h+"px"; if(h<=h1) {clearInterval(t1);start(c) }},10)
}
function show(s1,r1){
n=20;
divs = s1.getElementsByTagName('div');
for(var i=0; i<divs.length;i++){
divs[i].className='divs';
divs[i].style.left=r1*Math.cos(360/n*i)+'px';
divs[i].style.top=r1*Math.sin(360/n*i)+'px';
}
}
function start(s){
s.style.position='relative';
for(var i=0;i<20;i++){
s.appendChild(document.createElement('div'))['innerHTML']='*';
}
r=0;
show(s,r);

t = setInterval(function(){r=r+10;show(s,r); if(r>=150) {clearInterval(t);s.parentNode.removeChild(s); circle9 = new circle(); }},50)
}
circle1 = new circle();
</script>
</body>
</html>

返回页首  留言 [第1页/共1页]

您在这个论坛的权限:
不能在这个论坛回复主题

 




  

申请免费论坛 | ©phpBB | 互助中心 | 违法举报 | 最近的讨论