Начало Новини Маркет Проекти Форум ИТ Работа Уроци Скриптове WiFi точки Още Вход


Валящи снежинки

От eminem / 17.03.2005 10:10
Размер на шрифта: A | A | A

С помоща на този скрипт можете да направите "снежинки", които валят:). Доста прост скрипт. За снежинки съм използвал CODE
1
*
. Можете да го смените по ваше желание. Ето ви кода:

CODE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<html>
<
head>
<
title>snowstorm</title>
<
script language=javascript>
msGG="*****************************************************************************************************************************"
a=msGG.length
ss=new Array
SW
=eval(screen.availWidth)-12
Wv=SW/a
SL
=eval(screen.availHeight)-20
for(var i=0; i<a; i++){
if(navigator.appName=="Netscape"){
document.write("<layer id='buk"+i+"'  top="+(Math.random()*SW)+" left="+(i*Wv)+"><font color=#aadddd>"+msGG.charAt(i)+"</font></layer>")
ss[i]=0
}
else{
document.write("<div id='buk' style='position:absolute; top:"+(Math.random()*SW)+"; left:"+(i*Wv)+"; color:aadddd'>"+msGG.charAt(i)+"</div>")
ss[i]=Math.random()*SW
}
}

function go(){
if(navigator.appName=="Netscape"){
gosomewhereN()
}
else{
gosomewhereE()
}
}


function gosomewhereN(){
for(var j=0; j<a; j++){
x=Math.floor(Math.random()*25)
S=eval("document.buk"+j)
k=eval(S.top)
if(k<SL){
S.top+=x
}
else{
S.top=0
}
}
setTimeout("gosomewhereN()", 100)
}

 
function gosomewhereE(){
for(var j=0; j<a; j++){
x=Math.floor(Math.random()*25)+ss[j]
if(x<SL){
buk[j].style.top=x
}
else{
buk[j].style.top=0
x=0
}
ss[j]=x
}
setTimeout("gosomewhereE()", 100)
}


document.onload=go()
</
script>
</
head>
<
body bgcolor=226666>
</
body>
</
html>

Статистика
Погледнат: пъти
Гласове: --
Оценка:
Действие
 



myTech.bg © 2004 - 2011 | Контакти | За реклама