修改function snowIE()
{
    for (i = 0; i < no; ++ i)
    {
      if (yp[i] < doc_height-50)
      {
       yp[i] += sty[i];  
        dx[i] += stx[i];  
       document.all["dot"+i].style.pixelTop = yp[i];  
       document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);  
      }else
      {
          document.all["dot"+i].style.visibility = 'hidden';
      }
    }  
    setTimeout("snowIE()", 20);  
}

解决方案 »

  1.   

    以下在ie下执行通过,ns没有测试:
    1.找到  var no = 10;  改为    var no = 12;
    2.修改下面的两个函数:  function snowNS() {  // Netscape main animation function  
        for (i = 0; i < no; ++ i) {  // iterate for every dot  
          yp[i] += sty[i];  
          if (yp[i] <= doc_height-50) {  
    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() {  // IE main animation function  
        for (i = 0; i < no; ++ i) {  // iterate for every dot  
          yp[i] += sty[i];  
          if (yp[i] <= doc_height-50) {  
    dx[i] += stx[i];  
    document.all["dot"+i].style.pixelTop = yp[i];  
    document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);  
          }  
        }  
        setTimeout("snowIE()", 20);  
      }
      

  2.   

    首先,雪花个数由变量no控制
      var no = 10;  函数snowNS()和snowIE()中的
    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;  
      .....
    }
    使到底的雪花回到顶上,注释掉就可满足你的要求