Показать сообщение отдельно
  #13 (permalink)  
Старый 24.12.2011, 14:59
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,080

Goolfen, попробуйте этот вариант ...
<!DOCTYPE html>
<html>
<head>
  <title></title>
<script  type="text/javascript">
/*********************************** *********************************** ********************/
// SnowScript for IE, Mozilla and many more!
// © RoterFruchtZwerg 2003
// stumpf und schnell mal von uns ausgeliehen ;)

var imgNum = 0;
var snowImg = new Array();

snowImg[0] ="<span style=\"color: #AAAAAA; font-size: 8pt;\">*</span>";
snowImg[1] ="<span style=\"color: #AABBCC; font-size: 10pt;\">*</span>";

snowImg[0] ="<img src=\"http://cinema-life.3dn.ru/snow/snowjs.gif\" alt=\"*\"/>";
snowImg[1] ="<img src=\"http://cinema-life.3dn.ru/snow/snowjs2.gif\" alt=\"*\" />";


var no = 15;
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 800, doc_height = 600;
function getDocumentSize(a) {
    var d = document,
        b = d.body,
        e = d.documentElement,
        c = "client" + a;
        a = "scroll" + a;
    return /CSS/.test(d.compatMode)? Math.max(e[c],e[a]) : Math.max(b[c],b[a])
};


doc_width = getDocumentSize('Width')-12;
doc_height = getDocumentSize('Height')-12;

dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();

for (i = 0; i < no; ++ i) {

imgNum = imgNum?0:1;
var snowsrc = snowImg[imgNum];

dx[i] = 0;
xp[i] = Math.random()*(doc_width-60);
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*10;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
document.write("<div id=\"dot"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 1px; left: 1px; width:12px;\">"+snowsrc+"</div>");
}

function snow() {
for (i = 0; i < no; ++ i) {
yp[i] += sty[i];
if (yp[i] > doc_height-20) {
xp[i] = Math.random()*(doc_width-am[i]-20);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random()*2;
doc_width = getDocumentSize('Width');
doc_height = getDocumentSize('Height');
}
dx[i] += stx[i];
document.getElementById("dot"+i).style.top = Math.round(yp[i])+"px";
document.getElementById("dot"+i).style.left = Math.round(xp[i] + am[i]*Math.sin(dx[i]))+"px";
}
setTimeout("snow()", 60);
}


window.onload = snow

// SnowScript for IE, Mozilla and many more!
// © RoterFruchtZwerg 2003
// stumpf und schnell mal von uns ausgeliehen ;)
/*********************************** *********************************** ********************/
</script>
</head>

<body>

</body>

</html>

Последний раз редактировалось рони, 23.11.2015 в 18:05.
Ответить с цитированием