<SCRIPT language="JavaScript">
// FallT v1.0 By Maxx Blade - http://www.maxxblade.co.uk/
///////////// Only Edit these lines ////////////////
var no=5,speed=30,slider=30,fallmax=8,wind=0,fallwhat="ใส่ข้อความตรงนี้นะ",fallsize=10,fallfont="Tahoma";
var colours=new Array("FF008A","FD54B0","FC87C7","FCB4DB","FDD6EB","ใส่โค๊ตสีตรงนี้นะจ๊ะ");
//////////////////////////////////////////////////////
var o=new Array(), tog=1, dofallt=new Array();
var ns4=(document.layers)?1:0;
var ie4=(document.all)?1:0;
var ns6=(document.getElementById&&!document.all)?1:0;
if(ie4) falllayer="document.all['gf'+i].style";
if(ns4) falllayer="document.layers['gf'+i]";
if(ns6) falllayer="document.getElementById('gf'+i).style";
function winWid(){ return (ns4||ns6)?window.innerWidth:document.body.clientWidth; }
function winHei(){ return (ns4||ns6)?window.innerHeight:document.body.clientHeight; }
function winOfy(){ return (ns4||ns6)?window.pageYOffset:document.body.scrollTop; }
function togFall(){ for(i=0;i<no;i++){ if(tog==1){ with(eval(falllayer)){ left=-500; } clearTimeout(dofallt[i]); }else{ fallt(i); } } tog*=-1 }
function newobj(q,t){
spin = parseInt(Math.random()*slider);
spin = (Math.random()>0.5) ? spin : -spin;
o[q] = new Array(parseInt(Math.random()*(winWid()-slider)),-30,spin,0.02+Math.random()/10,parseInt(1+Math.random()*fallmax),0);
if(t==1){
if(ns4){ ; }
if(ie4||ns6){ ; }
}
}
function fallt(i){
if((o[i][1]>winHei()-(fallsize*1.5))||(o[i][0]>winWid()-slider-(fallsize*fallwhat.length))){ newobj(i,0); }
o[i][1] += o[i][4];
o[i][0]+=wind;
o[i][5] += o[i][3];
sizexy=Math.sin(o[i][5]);
lay=(ie4)?sizexy:parseInt(sizexy+1);
sizexy=(sizexy>0)?sizexy:0-sizexy;
with(eval(falllayer)){
top = o[i][1]+winOfy();
left = o[i][0]+o[i][2]*Math.cos(o[i][5]);
if(!ns4){
zIndex=lay;
color=colours[parseInt(sizexy*(colours.length-1))]
}
}
dofallt[i] = setTimeout("fallt("+i+")", speed);
}
for (i = 0; i < no; i++){ newobj(i,1); fallt(i); }
</SCRIPT>
Me I
ความคิดเห็น