|
Animated Falling Objects For Your Page |
|
|
Author |
Message |
prince_zurich101
Graphic Designer
> : I love HCG!
Posts : 252
Age : 35
Reg-Date : 2008-09-10
Forum Warning :
Contribution :
|
Subject: Animated Falling Objects For Your Page Fri Sep 12, 2008 10:36 am |
|
|
Title: Falling Objects Tested With: NN, FF, IE7 Live Preview : http://profiles.friendster.com/znarf101 - Spoiler:
setconfig("http://www.fallingobjects.info/gifs/1197822659523.gif",10,2); var oldwindoww,oldwindowh,windoww,windowh,whichbrowser,picture,total,speed,oldhiddentop,hiddentop,moving; window.onresize = windowsize; window.onscroll = scrollcheck;
function browsertype() { if(!document.all) { if(document.getElementById) whichbrowser=1; } else whichbrowser=2; }
function windowsize() { if(whichbrowser=="") browsertype(); if(whichbrowser==1) { if(oldwindoww=="") oldwindoww=window.innerWidth; else oldwindoww=windoww; windoww=window.innerWidth; if(oldwindowh=="") oldwindowh=window.innerHeight; else oldwindowh=windowh; windowh=window.innerHeight+hiddentop; } else { if(oldwindoww=="") oldwindoww=document.body.clientWidth; else oldwindoww=windoww; windoww=document.body.clientWidth; if(oldwindowh=="") oldwindowh=document.body.clientHeight; else oldwindowh=windowh; windowh=document.body.clientHeight+hiddentop; } if(moving) { var averagediff = (windoww-oldwindoww)/oldwindoww; var averagediff2 = (windowh-oldwindowh)/oldwindowh; for(i=1;i<=total;i++) { var checkleft = parseInt(document.getElementById("movingobject"+i).style.left); var newleft = parseInt(checkleft+averagediff*checkleft); if(newleft<0) newleft=0; if(newleft>(windoww-70)) newleft = windoww-70;
document.getElementById("movingobject"+i).style.left = newleft;
var checktop = parseInt(document.getElementById("movingobject"+i).style.top); var newtop = parseInt(checktop+averagediff2*checktop); if(newtop>(windowh-50)) newtop=Math.round(Math.random()*(-600)-100); document.getElementById("movingobject"+i).style.top = newtop; } } }
function scrollcheck(){ if(whichbrowser=="") browsertype(); if(whichbrowser==1) { oldhiddentop=hiddentop; hiddentop = window.pageYOffset; } else { oldhiddentop=hiddentop; hiddentop = document.body.scrollTop; } //alert(hiddentop+ " "+oldhiddentop); if(moving) { oldwindowh=windowh; windowh=windowh+(hiddentop-oldhiddentop); for(i=1;i<=total;i++) { var checktop = parseInt(document.getElementById("movingobject"+i).style.top); var newtop = parseInt(checktop+(hiddentop-oldhiddentop)); document.getElementById("movingobject"+i).style.top = newtop; } } }
function setconfig(temppicture,temptotal,tempspeed) { if(tempspeed>3) tempspeed=3; if(tempspeed<1) tempspeed=1; if(temptotal<10) temptotal=10; if(temptotal>100) temptotal = 100; oldhiddentop=0; hiddentop=0; picture = temppicture; total = temptotal; speed = tempspeed; browsertype(); windowsize(); scrollcheck(); populate(); move(); }
function populate() { var randleft; var randtop; for(i=1;i<=total;i++) { randleft = Math.round(Math.random()*(windoww-100)+30); randtop = Math.round(Math.random()*(-600)-100); if(randleft<0) randleft=0; document.write("<img src='"+picture+"' id='movingobject"+i+"' style='position:absolute; top:"+randtop+"px; left:"+randleft+"px'>"); } } function move() { var movedown; var moveleft; var currenttop; var currentleft; var newtop; var newleft; moving = 1; for(i=1;i<=total;i++) { movedown = Math.round(Math.random()*speed+speed) currenttop = parseInt(document.getElementById("movingobject"+i).style.top); newtop = parseInt(currenttop+movedown); if(newtop>(windowh-50)) { document.getElementById("movingobject"+i).style.top=hiddentop; continue; }
currentleft = parseInt(document.getElementById("movingobject"+i).style.left); moveleft = Math.round(Math.cos(Math.random()*Math.PI)*1.5); if(parseInt(currentleft+moveleft)<(windoww-70)) newleft = parseInt(currentleft+moveleft); else newleft = parseInt(currentleft-moveleft);
document.getElementById("movingobject"+i).style.top= newtop; document.getElementById("movingobject"+i).style.left= newleft; } setTimeout("move()",90/speed); }
Legends: * Blue the URL of the GIF image. * Yellow the number of objects.. (its up to you how many objects will fall.) * Orange the speed. a. 1 is Slow b. 2 is Medium c. 3 is Fast Credits: Christian of TheCradle Stormpage.com And Me.... Haw...Haw.... Save iT As Js... That's all.... EnJoy....!!
|
|
|
|
darkmaster
Graphic Designer
> : I love HCG!
Posts : 435
Age : 35
Location : Some WeRe Out ThErE..
Reg-Date : 2008-09-09
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Sat Sep 13, 2008 2:44 am |
|
|
haw haw haw... Nice one Bro... ^_~.......
|
|
|
|
bitter piLL
HCG Addict
> : I love HCG!
Posts : 286
Age : 32
Location : SomeWhereDownTheRoad
Reg-Date : 2008-09-09
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Sat Sep 13, 2008 12:54 pm |
|
|
thanks for sharing!! more power to you!! :27:
|
|
|
|
Chirokipau
Global Mod
> : LOL?XD
Posts : 1836
Age : 31
Location : Cavite.General trias.
Mood : Happy
Country :
Reg-Date : 2008-09-04
Forum Warning :
Contribution :
|
Subject: XD Sat Sep 13, 2008 12:57 pm |
|
|
Nice sharing of trick.. Kip it up dude..
|
|
|
|
prince_zurich101
Graphic Designer
> : I love HCG!
Posts : 252
Age : 35
Reg-Date : 2008-09-10
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Sat Sep 13, 2008 2:47 pm |
|
|
Thanks bro Aye and bitter piLL.... :35:
|
|
|
|
kaede
Guest
> : I love HCG!
Posts : 5
Age : 31
Location : San Jose Ca.
Country :
Reg-Date : 2008-10-20
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Mon Oct 20, 2008 3:30 am |
|
|
|
|
|
|
preppychiq03
Guest
> : sometimes the things you plan
Posts : 3
Age : 29
Location : zamboanga city
Mood : Anxious
Country :
Reg-Date : 2008-10-28
Forum Warning :
Contribution :
|
Subject: hey pwd ba animated ung image? Tue Oct 28, 2008 6:07 pm |
|
|
pwd animated ung image?
|
|
|
|
prince_zurich101
Graphic Designer
> : I love HCG!
Posts : 252
Age : 35
Reg-Date : 2008-09-10
Forum Warning :
Contribution :
|
|
|
|
shikamaru0516
HCG Member
> : I love HCG!
Posts : 11
Location : taipei, taiwan...lol
Mood : Bored
Country :
Reg-Date : 2008-10-26
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Mon Nov 10, 2008 10:39 pm |
|
|
|
|
|
|
[mystic] rain
HCG Member
> : I love HCG!
Posts : 41
Age : 31
Reg-Date : 2008-11-11
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Tue Nov 11, 2008 6:05 pm |
|
|
wow nice trick i like it! ahihihihi thanks for sharing
|
|
|
|
jhedz
Guest
> : I love HCG!
Posts : 2
Reg-Date : 2008-11-09
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Tue Nov 11, 2008 6:15 pm |
|
|
kelangan pa po bang igenerate? ...hmm
|
|
|
|
awra
HCG Elite
> : now, your turn.
Posts : 1815
Age : 35
Location : KMB
Country :
Reg-Date : 2008-09-23
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Tue Nov 11, 2008 9:12 pm |
|
|
|
|
|
|
3xc
HCG Wizard
> : I love HCG!
Posts : 68
Age : 34
Reg-Date : 2008-11-25
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Tue Nov 25, 2008 2:21 pm |
|
|
nice
|
|
|
|
raymond
HCG Maniac
> : can I be your MOMMY and DADDY?
Posts : 3549
Age : 33
Location : In the USA, the big CIA
Country :
Reg-Date : 2008-11-01
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Sun Nov 30, 2008 9:27 am |
|
|
WOW this is alternative for snow. i will use this before the xmass. thx bro
|
|
|
|
certifiedbratinela:)
HCG Freak
> : i<3HCG (:
Posts : 176
Age : 29
Mood : Happy
Country :
Reg-Date : 2008-10-19
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Thu Dec 04, 2008 7:25 pm |
|
|
|
|
|
|
lolli.princess27
HCG Wizard
> : treat yourself right :))
Posts : 64
Age : 99
Location : in yerr heart :))
Mood : Crazy
Country :
Reg-Date : 2008-11-23
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Thu Dec 04, 2008 7:42 pm |
|
|
<small><b>can i use it in set 7????, tnx, </small>
|
|
|
|
× L U S H Y ×
Contributor
> : la la la ...
Posts : 6460
Age : 32
Location : makati
Mood : Cheerful
Country :
Reg-Date : 2008-11-20
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Fri Dec 05, 2008 10:38 am |
|
|
|
|
|
|
JirO™
Global Mod
> : >:)
Posts : 2580
Age : 31
Location : There :O
Mood : Blissful
Country :
Reg-Date : 2008-09-05
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Sat Dec 06, 2008 10:45 am |
|
|
^Please use even 10 characters when posting/replying..1 smiley is considered as a spam.30 warning pts for you :]
|
|
|
|
Mitchz
HCG Freak
> : I love HCG!
Posts : 177
Location : Universe-Earth-Asia-Phils.-Manila
Reg-Date : 2008-12-02
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Sat Dec 06, 2008 12:13 pm |
|
|
|
|
|
|
prettyprincess23
HCG Wizard
> : iloveyou :)
Posts : 66
Age : 30
Location : makati:)
Mood : Angry
Reg-Date : 2008-11-20
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Sat Dec 06, 2008 6:19 pm |
|
|
|
|
|
|
prettyprincess23
HCG Wizard
> : iloveyou :)
Posts : 66
Age : 30
Location : makati:)
Mood : Angry
Reg-Date : 2008-11-20
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Sat Dec 06, 2008 6:20 pm |
|
|
|
|
|
|
prettyprincess23
HCG Wizard
> : iloveyou :)
Posts : 66
Age : 30
Location : makati:)
Mood : Angry
Reg-Date : 2008-11-20
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Sat Dec 06, 2008 6:20 pm |
|
|
sunggiiiit naman ni kuya jiirooo :) hhaha iit workeed naman :)
|
|
|
|
prettyprincess23
HCG Wizard
> : iloveyou :)
Posts : 66
Age : 30
Location : makati:)
Mood : Angry
Reg-Date : 2008-11-20
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Sat Dec 06, 2008 6:21 pm |
|
|
|
|
|
|
ayako
Promoter
> : ~tralala. :)
Posts : 1164
Age : 29
Mood : Content
Reg-Date : 2008-10-27
Forum Warning :
Contribution :
|
Subject: Re: Animated Falling Objects For Your Page Sat Dec 06, 2008 9:05 pm |
|
|
NO DOUBLE POSTING PLEASE (should i say triple posting? ) @t : woot. good one. thanks for sharing!
|
|
|
|
magel14
Guest
> : single :p
Posts : 5
Age : 30
Location : samar
Reg-Date : 2008-11-21
Forum Warning :
Contribution :
|
|
|
|
Sponsored content
|
Subject: Re: Animated Falling Objects For Your Page |
|
|
|
|
|
|
|
Animated Falling Objects For Your Page |
|
|