fei 发表于 2007-4-27 11:28:15

***页面背景***礼花式样的背景

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
要完成此效果把如下代码加入到<body>区域中

<layer name="a0" left=10 top=10 visibility=show bgcolor="#ffffff" clip="0,0,1,1"></layer>
<layer name="a1" left=10 top=10 visibility=show bgcolor="#fff000" clip="0,0,1,1"></layer>

<layer name="a2" left=10 top=10 visibility=show bgcolor="#ffa000" clip="0,0,1,1"></layer>
<layer name="a3" left=10 top=10 visibility=show bgcolor="#ff00ff" clip="0,0,1,1"></layer>
<layer name="a4" left=10 top=10 visibility=show bgcolor="#00ff00" clip="0,0,1,1"></layer>
<layer name="a5" left=10 top=10 visibility=show bgcolor="#ff00ff" clip="0,0,1,1"></layer>
<layer name="a6" left=10 top=10 visibility=show bgcolor="#ff0000" clip="0,0,1,1"></layer>
<layer name="a7" left=10 top=10 visibility=show bgcolor="#ffffff" clip="0,0,1,1"></layer>
<layer name="a8" left=10 top=10 visibility=show bgcolor="#fff000" clip="0,0,1,1"></layer>
<layer name="a9" left=10 top=10 visibility=show bgcolor="#ffa000" clip="0,0,1,1"></layer>
<layer name="a10" left=10 top=10 visibility=show bgcolor="#ff00ff" clip="0,0,1,1"></layer>
<layer name="a11" left=10 top=10 visibility=show bgcolor="#00ff00" clip="0,0,2,2"></layer>
<layer name="a12" left=10 top=10 visibility=show bgcolor="#0000ff" clip="0,0,2,2"></layer>
<layer name="a13" left=10 top=10 visibility=show bgcolor="#ff0000" clip="0,0,2,2"></layer>
<div id="starsdiv" style="position:absolute;top:0px;left:0px">
<div style="position:relative;width:2px;height:2px;background:#ffffff;font-size:2px"></div>
<div style="position:relative;width:1px;height:1px;background:#fff000;font-size:1px"></div>
<div style="position:relative;width:1px;height:1px;background:#ffa000;font-size:1px"></div>
<div style="position:relative;width:1px;height:1px;background:#ff00ff;font-size:1px"></div>
<div style="position:relative;width:1px;height:1px;background:#00ff00;font-size:1px"></div>
<div style="position:relative;width:1px;height:1px;background:#0000ff;font-size:1px"></div>
<div style="position:relative;width:1px;height:1px;background:#ff0000;font-size:1px"></div>
<div style="position:relative;width:1px;height:1px;background:#ffffff;font-size:1px"></div>
<div style="position:relative;width:1px;height:1px;background:#fff000;font-size:1px"></div>
<div style="position:relative;width:1px;height:1px;background:#ffa000;font-size:1px"></div>
<div style="position:relative;width:1px;height:1px;background:#ff00ff;font-size:1px"></div>
<div style="position:relative;width:2px;height:2px;background:#ff00ff;font-size:2px"></div>
<div style="position:relative;width:1px;height:1px;background:#0000ff;font-size:1px"></div>
<div style="position:relative;width:1px;height:1px;background:#ff0000;font-size:1px"></div>
</div>

<script language="javascript">

<!-- begin
var clrs = new array(9);
clrs = 'ff0000';
clrs = '00ff00';
clrs = '000aff';
clrs = 'ff00ff';
clrs = 'ffa500';
clrs = 'ffff00';
clrs = '00ff00';
clrs = 'ffffff';
clrs = 'fffff0';
var sclrs = new array(5);
sclrs = 'ffa500';
sclrs = '55ff66';
sclrs = 'ac9dfc';
sclrs = 'fff000';
sclrs = 'fffff0';
var ybase;
var xbase;
var step;
var currstep = 0;
var xpos = 1;
var ypos = 1;
var initialstarcolor = 'ffa000';
var mtop = 250;
var mleft = 250;
function fireworks() {
if (document.all) {
ybase = window.document.body.offsetheight / 3;
xbase = window.document.body.offsetwidth / 8;
}
else if (document.layers) {
ybase = window.innerheight / 3;
xbase = window.innerwidth / 8;
}
if (document.all) {
step = 5;
for ( i = 0 ; i < starsdiv.all.length ; i++ ) {
for (ai = 0; ai < clrs.length; ai++) {
var c = math.round(math.random()*);
}
if (currstep < 90)
starsdiv.all.style.background=initialstarcolor;
if (currstep > 90)
starsdiv.all.style.background=clrs;
starsdiv.all.style.top = mtop + ybase*math.sin((currstep+i*5)/3)*math.sin(550+currstep/100)
starsdiv.all.style.left = mleft + ybase*math.cos((currstep+i*5)/3)*math.sin(550+currstep/100)
   }
}
else if (document.layers) {
step = 5;
for ( j = 0 ; j < 24 ; j++ ) { //number of ns layers!
var templayer = "a"+j;
for (ai = 0; ai < clrs.length; ai++) {
var c = math.round(math.random()*);
}
if (currstep < 90)
document.layers.bgcolor=initialstarcolor;
if (currstep > 90)
document.layers.bgcolor=clrs;
document.layers.top = mtop +

ybase*math.sin((currstep+j*5)/3)*math.sin(550+currstep/100)
document.layers.left = mleft +

ybase*math.cos((currstep+j*5)/3)*math.sin(550+currstep/100)
   }
}
currstep+= step;
t=settimeout("fireworks()",5);
if (currstep == 220) {
currstep = -10;
for (n = 0; n < sclrs.length; n++) {
var k = math.round(math.random()*n);
}
initialstarcolor = sclrs;
if (document.all) {
dtop = window.document.body.clientheight - 250;
dleft = xbase * 3.5;
mtop = math.round(math.random()*dtop);
mleft = math.round(math.random()*dleft);
document.all.starsdiv.style.top = mtop+document.body.scrolltop;
document.all.starsdiv.style.left = mleft+document.body.scrollleft;
}
else if (document.layers) {
dleft = window.innerwidth - 100;
dtop = window.innerheight - 100;
mtop = math.round(math.random()*dtop+window.pageyoffset);
mleft = math.round(math.random()*dleft+window.pagexoffset);
document.layers.top = mtop;
document.layers.left = mleft;
}
if ((mtop < 20) || (mleft < 20)) {
mtop += 90;
mleft += 90;
      }
   }
}
fireworks();
//end -->
</script>
    <input type="button" name="submit" value="保存代码" onclick="savefile(htmlcontent.value,'礼花









--------------------------------------

拥有三人行论坛管理系列软件,一个人就可以管理一个论坛的更新维护。还能使您的论坛有千人在线的真实火暴效果,让您不在为论坛因没有人气而留不住会员而烦恼,使您的论坛早日成为一流的论坛。详情请登陆网站:http://www.cnsrx.cn 三人行论坛管理软件,站长必备的专业好工具。(您使用的是免费版本,购买收费版本后,将不带广告。业务QQ:247216 44985227)
页: [1]
查看完整版本: ***页面背景***礼花式样的背景