Mª Nieves Pérez
//
// Fall v2.0 By MaxxBlade - http://www.maxxblade.co.uk/fall
var fallObjects=new Array();function newObject(url,height,width){fallObjects[fallObjects.length]=new Array(url,height,width);}
var numObjs=15, waft=100, fallSpeed=5, wind=-1;
newObject("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5XeZgwjiYs2TIWwSwWzCVDiGUDRu50dHwkc2WB3QeMj2Q98Rzq8Plgw4tZAJAudeISTnyco2muFsadwDFzWrt4-Xl-HWtBoxFnbULcaO6JSi3RG5eXIXwWGBeBmnuYIvww_QGlCdx3wE/s100/hoja1.png",29,15);
newObject("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiui3B_IKEUIqG_5sJ4pQeY33gBshCnjQ5E-4GhRC_7BcM5UyHi-u4CXx8xCQY5I_JHtfij7TkCxqBCYhXS9ym_PZOAo1SELYOmZC4zVbYJjtKBLSacMuEza5GwtD2tmd65nDNS23YMzWU/s100/hoja2.png",27,23);
newObject("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy7fz3swv6G6zsRTqCzvmxrGznE5ppsnsP8yW8Zhx_hBHv1J_6btfUrlOLWUSDp3Kj4kQwZL2PlAPWGa0MgmUekJ3GfD1RQph-Ku9H63wzAhsko_aXFpolq0426mhW2yoNcjnTmokJdfc/s100/hoja3.png",46,15);
newObject("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRifSTL42keeJLh8P5Defb4LsPYYTmVTbPcz1U4tsJKk7uYWOqnK3oZPRcpw7MD0MUGgcFMbQqOVyQJLwDh0NQTwwtmtOXEtEbeJ6ieG5IQEjAmZCpP8pvEt5HnqboM8143MYID3xrC5Q/s100/hoja4.png",36,33);
function winSize(){winWidth=(moz)?window.innerWidth:document.body.clientWidth;winHeight=(moz)?window.innerHeight:document.body.clientHeight;}
function fallObject(num,vari,nu){
objects[num]=new Array(parseInt(Math.random()*(winWidth-waft)),-30,(parseInt(Math.random()*waft))*((Math.random()>0.5)?1:-1),0.02+Math.random()/20,0,1+parseInt(Math.random()*fallSpeed),vari,fallObjects[vari][1],fallObjects[vari][2]);
if(nu==1){document.write(''); }
}
function fall(){
for(i=0;i
var fallingObject=document.getElementById('fO'+i);
if((objects[i][1]>(winHeight-(objects[i][5]+objects[i][7])))||(objects[i][0]>(winWidth-(objects[i][2]+objects[i][8])))){fallObject(i,objects[i][6],0);}
objects[i][0]+=wind;objects[i][1]+=objects[i][5];objects[i][4]+=objects[i][3];
with(fallingObject.style){ top=objects[i][1]+winOffset+"px";left=objects[i][0]+(objects[i][2]*Math.cos(objects[i][4]))+"px";}
}
setTimeout("fall()",31);
}
var objects=new Array(),winOffset=0,winHeight,winWidth,togvis,moz=(document.getElementById&&!document.all)?1:0;winSize();
for (i=0;i
window.onresize=winSize;fall();
//]]>
Muy bien hecho, seño. Buen trabajo.
ResponderEliminar