Programalama > JAVA SCRIPT

Etiketler: müthiş, bir, arka, blan, deneyin

Ort. 0
Puan ver:
<script Language="JavaScript">
//----   Choice of variables   ----\var widt=screen.width-25
var heig=600
var numb=500
//---------The description---------\/*
widt - the variable indicates the width of your page (you can change it as you like). We bring forward width of monitor screen supposing that browser window was unfolded. 
heig - you can choose a height, e.g. 1000 px., whichever you like. 
numb - stars number (we have 200 ones).
*/
//----------------------------------\
var ns=document.layers?1:0
var ie4=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0

var NN=(document.layers ? true:false)
colo=new Array(numb)
j=0
tx=""
if(ns)
{
	tx=tx+"."
}
else
{
	document.write(" .")
}
for (i=0; i <numb ; i++)
{
	x=Math.floor(Math.random()*widt)
	y=Math.floor(Math.random()*heig)
	wi=Math.random()*1.8+1
	col="#ffee99"
	n=0
	if (wi<1.2){col="#eeeeff";n=4}
	if (wi>2.6){col="#ffaa88";n=8}
	if (Math.random()>.7){nam="r"+j; colo[j]=n;j=j+1}
	else{nam=""}
wi=Math.floor(wi)
	he=wi
	if (ns)
	{
		tx=tx+"<layer z-Index=0 "+((nam)?"name="+nam:"")+" left="+x+" top="+y+" width="+wi+" height="+he+" bgColor="+col+"></layer>"
	}
	else
	{
		document.write("<div "+((nam)?"id="+nam:"")+"  style='z-index:0; position:absolute; left:"+x+";top:"+y+";width:"+wi+";height:"+he+";background:"+col+"'><img  width=1 height=1></div>")
	}
if(ns){document.write (tx);tx=""}

}

function recolor()
{
for (i=0; i<j; i++)
	{
		if (colo[i]==0){co=cols[Math.floor(Math.random()*4)]}
		if (colo[i]==4){co=cols[4+Math.floor(Math.random()*4)]}
		if (colo[i]==8){co=cols[8+Math.floor(Math.random()*4)]}
		
		if (ns) {document.layers["r"+i].bgColor=co}
		if (ie4){document.all["r"+i].style.background=co}
		if (ns6){document.getElementById("r"+i).style.background=co}
	}
}
cols=new Array("#ffee99","#eedd88","#ddcc77","#ccbb66","#eeeeff","#ddddee","#ccccdd","#bbbbcc","#ffaa88","#ee9977","#dd8866","#cc7755")
tim=window.setInterval("recolor()",2)
</script>

ibrahim çolak
aska_dav@hotmail.com


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2024 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.