香烟 发表于 2007-4-27 11:22:40

***综合类***飘雪花效果

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
<html>
<head>
<title>:::飘雪花效果:::网页特效代码:::ik8网络家园http://www.ik8.com</title>
</head>
<body bgcolor="#000000">
<script language=javascript1.2>
   var snowsrc="img/snow.gif"
   var no = 10;
   var ns4up = (document.layers) ? 1 : 0;// browser sniffer
   var ie4up = (document.all) ? 1 : 0;
   var dx, xp, yp;    // coordinate and position variables
   var am, stx, sty;// amplitude and step variables
   var i, doc_width = 800, doc_height =600;
   if (ns4up) {
   doc_width = self.innerwidth;
   doc_height = self.innerheight;
   } else if (ie4up) {
   doc_width = document.body.clientwidth;
   doc_height = document.body.clientheight;
   }

   dx = new array();
   xp = new array();
   yp = new array();
   am = new array();
   stx = new array();
   sty = new array();
   for (i = 0; i < no; ++ i) {
   dx = 0;                        // set coordinate variables
   xp = math.random()*(doc_width-50);// set position variables
   yp = math.random()*doc_height;
   am = math.random()*20;         // set amplitude variables
   stx = 0.02 + math.random()/10; // set step variables
   sty = 0.7 + math.random();   // set step variables
   if (ns4up) {                      // set layers
       if (i == 0) {
         document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><a href=\"http://www.ik8.com/\"><img src='"+snowsrc+"' border=\"0\">http://code.ik8.com/html/+snowsrc+</a></layer>");
       } else {
         document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\">http://code.ik8.com/html/+snowsrc+</layer>");
       }
   } else if (ie4up) {
       if (i == 0) {
         document.write("<div id=\"dot"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 15px; left: 15px;\"><a href=\"http://www.ik8.com\"><img src='"+snowsrc+"' border=\"0\">http://code.ik8.com/html/+snowsrc+</a></div>");
       } else {
         document.write("<div id=\"dot"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 15px; left: 15px;\"><img src='"+snowsrc+"' border=\"0\">http://code.ik8.com/html/+snowsrc+</div>");

       }
   }
   }
   function snowns() {// netscape main animation function
   for (i = 0; i < no; ++ i) {// iterate for every dot
       yp += sty;
       if (yp > doc_height-50) {
         xp = math.random()*(doc_width-am-30);
         yp = 0;
         stx = 0.02 + math.random()/10;
         sty = 0.7 + math.random();
         doc_width = self.innerwidth;
         doc_height = self.innerheight;
       }
       dx += stx;
       document.layers["dot"+i].top = yp;
       document.layers["dot"+i].left = xp + am*math.sin(dx);
   }
   settimeout("snowns()", 10);
   }

   function snowie() {// ie main animation function
   for (i = 0; i < no; ++ i) {// iterate for every dot
       yp += sty;
       if (yp > doc_height-50) {
         xp = math.random()*(doc_width-am-30);
         yp = 0;
         stx = 0.02 + math.random()/10;
         sty = 0.7 + math.random();
         doc_width = document.body.clientwidth;
         doc_height = document.body.clientheight;
       }
       dx += stx;
       document.all["dot"+i].style.pixeltop = yp;
       document.all["dot"+i].style.pixelleft = xp + am*math.sin(dx);
   }
   settimeout("snowie()", 10);
   }

   if (ns4up) {
   snowns();
   } else if (ie4up) {
   snowie();
   }
</script>
      <table border="0" width="100%" cellpadding="0">
      <tr>
          <td width="100%"><font color="#ffffff" size="2"><b>飘雪花效果</b>注意保存这个图片(<img border="1" src="img/snow.gif" width="16" height="17">)http://code.ik8.com/html/img/snow.gif</font></td>
      </tr>
      <tr>
          <td width="100%">
</table>
</body>   
   
</html>
      










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

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