Показать сообщение отдельно
  #2 (permalink)  
Старый 30.12.2014, 21:56
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,103

se4a, снежок
<!DOCTYPE HTML>

<html>

<head>
  <title>Untitled</title>
  <style type="text/css">
  body{
    background-color: rgb(0, 255, 255);
  }

  </style>
</head>

<body>
<script>
 /////////////////////////////////////////////////
 //Автор Скрипта - Федор А. Нохрин aka FANTAzeRus/
 /////////////////////////////////////////////////

 var no = 15; // колличество снежинок
var speed =25; // скорость снежинок
var snowflake = "http://www.sbor.net/~fantazer/fanta/sneg.gif";

 var ns4up =  0;
 var ie4up = 1
 var dx, xp, yp;
 var am, stx, sty;
 var i, doc_width = 800, doc_height = 600;
 doc_width = document.documentElement.scrollWidth;
 doc_height = Math.max(document.documentElement.scrollHeight,document.documentElement.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();

       document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
       document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
       document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
       document.write(snowflake + "\" border=\"0\"></div>");
      }





 function snowIE()
  {
   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 = document.documentElement.scrollWidth;
       doc_height = Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight);
      }
     dx[i] += stx[i];

    document.getElementById("dot"+i).style.top = yp[i]+"px";
    document.getElementById("dot"+i).style.left = xp[i] + am[i]*Math.sin(dx[i])+"px";
    }
   setTimeout("snowIE()", speed);
  }

   snowIE();



 </script>

</body>

</html>

Последний раз редактировалось рони, 30.12.2014 в 22:01.
Ответить с цитированием