• 文字广告位
  • 文字广告位
  • 文字广告位
您现在的位置: 站长手册 >> 特效代码 >> 窗口类 >> 正文
站内搜索
Google
[图文]漫天飘落的雪花
        ★★★   

漫天飘落的雪花

雅虎收藏夹 百度收藏 Google书签 Yahoo书签 新浪ViVi 搜狐网摘 365Key网摘 天极网摘 diglog 和讯网摘 POCO网摘 YouNote网摘 博拉网 天下图摘 Del.icio.us digg reddit spurl BlinkList blogmarks
人气: 来源:本站原创 作者:佚名 所属栏目:窗口类 [切换到繁體中文]
介绍:飘飘洒洒的雪花,冬天来了,快装扮一下你的网页吧!

演示:

[Ctrl+A全选 提示:你可先修改部分代码,再按运行]

下面教你如何应用此特效:
 --------------------------------------------------------------------------------------
  需要在<body 这里>加入的代码:
 --------------------------------------------------------------------------------------
以下代码加到<head>…</head>中
以下代码加到<body>…</body>中
<script language="JavaScript1.2">
  var snowsrc="/texiao/zzsc_demo/snow.gif"
  var no = 10;
  var ns4up = (document.layers) ? 1 : 0;
  var ie4up = (document.all) ? 1 : 0;
  var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
  var dx, xp, yp;
  var am, stx, sty;
  var I, doc_width = 800, doc_height = 600;
    if (ns4up||ns6up) {
    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[I] = 0;
    xp[I] = Math.random()*(doc_width-50);
    yp[I] = Math.random()*doc_height;
    am[I] = Math.random()*20;
    stx[I] = 0.02 + Math.random()/10;
    sty[I] = 0.7 + Math.random();
    if (ns4up) {
      if (I == 0) {
        document.write("<layer name=\"dot"+ I +"\" left=\"15\" top=\"15\" visibility=\"show\"><a href=\"http://smallrain.net/\"><img src='"+snowsrc+"' border=\"0\"></a></layer>");
      } else {
        document.write("<layer name=\"dot"+ I +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"></layer>");
      }
    } else if (ie4up||ns6up) {
      if (I == 0) {
        document.write("<div id=\"dot"+ I +"\" style=\"POSITION: absolute; Z-INDEX: "+ I +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://smallrain.net\"><img src='"+snowsrc+"' border=\"0\"></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\"></div>");
      }
    }
  }
  function snowNS() {
    for (I = 0; I < no; ++ I) {
      yp[I] += sty[I];
      if (yp[I] > doc_height-50) {
        xp[I] = Math.random()*(doc_width-am[I]-30);
        yp[I] = 0;
        stx[I] = 0.02 + Math.random()/10;
        sty[I] = 0.7 + Math.random();
        doc_width = self.innerWidth;
        doc_height = self.innerHeight;
      }
      dx[I] += stx[I];
      document.layers["dot"+I].top = yp[I];
      document.layers["dot"+I].left = xp[I] + am[I]*Math.sin(dx[I]);
    }
    setTimeout("snowNS()", 10);
  }

  function snowIE_NS6() {
    for (I = 0; I < no; ++ I) {
      yp[I] += sty[I];
      if (yp[I] > doc_height-50) {
        xp[I] = Math.random()*(doc_width-am[I]-30);
        yp[I] = 0;
        stx[I] = 0.02 + Math.random()/10;
        sty[I] = 0.7 + Math.random();
        doc_width = ns6up?window.innerWidth : document.body.clientWidth;
        doc_height = ns6up?window.innerHeight : document.body.clientHeight;
      }
      dx[I] += stx[I];
      if (ie4up){
      document.all["dot"+I].style.pixelTop = yp[I];
      document.all["dot"+I].style.pixelLeft = xp[I] + am[I]*Math.sin(dx[I]);
      }
      else if (ns6up){
      document.getElementById("dot"+I).style.top=yp[I];
      document.getElementById("dot"+I).style.left=xp[I] + am[I]*Math.sin(dx[I]);
      }
    }
    setTimeout("snowIE_NS6()", 10);
  }

  if (ns4up) {
    snowNS();
  } else if (ie4up||ns6up) {
    snowIE_NS6();
  }

</script>

  • 上一个特效:
  • 下一个特效:
  • 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    姓 名: *(必填项) ·注册用户·
    Email: QQ号:
    评 分: 1分 2分 3分 4分 5分
    • 您可以发表评论支持你喜欢的文章。
    • 请遵守《互联网电子公告服务管理规定》
    • 请遵守中华人民共和国各项有关法律法规。
    • 严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
    • 评论人需对自己在使用评论过程中的行为承担法律责任。
    • 本站管理员有权保留或删除评论内容。
    • 评论内容只代表个人观点,与本网站立场无关。
    站内特效搜索
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | | 京ICP备 05004866号 |
    版权所有 2007-2008 站长手册 WWW.ZZSC.ORG 业务联系 zzsc.org#gmail.com