~Catster Codes Forum~
Back to Catster Codes 
Visit Catster or Dogster 
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 08, 2010, 09:05:29 AM


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Make Your Own Falling Objects!  (Read 829 times)
Neferkitty 
« on: September 25, 2009, 12:06:59 PM »

If you would like to use your own images for falling objects, this code is for you!  Cool


Code:
<script type="text/javascript">
<!--
var fallObjects=new Array();function newObject(url,height,width){fallObjects[fallObjects.length]=new Array(url,height,width);}
///////////// EDIT THIS SECTION //////////////
var numObjs=20, waft=50, fallSpeed=20, wind=0;
newObject("http://www.twilightmoon.net/catster/fall/snowflakea.gif",10,10);
newObject("http://www.twilightmoon.net/catster/fall/snowflake2a.gif",10,10);
newObject("http://www.twilightmoon.net/catster/fall/snowflake3a.gif",10,10);
newObject("http://www.twilightmoon.net/catster/fall/snowflake4a.gif",10,10);
//////////////////////////////////////////////// -->
</script>
<script language="JavaScript" src="http://www.twilightmoon.net/cc/js/fallingobjects.js"></script>


The above code uses 4 images, but you can use as many or as few as you want.


Edit the code with your own image locations. The highlighted part below is really the only thing you need to change:

newObject("http://www.twilightmoon.net/catster/fall/snowflakea.gif",10,10);


It's not necessary, but you can also play around with the numbers in
var numObjs=20, waft=50, fallSpeed=20, wind=0;


Have fun and feel free to post any questions or problems you have here.




The following members say thank you for this useful post:

Oly, dlr001, Snowdrops10

For this post, 3 members gave a thank you!
Logged

IzzysMom 
~~
*
Posts: 5


View Profile
« Reply #1 on: November 26, 2009, 02:13:42 AM »

Thank you for this code.  I have a question.  How do I get the falling object without a background?  Even if I delete the background it still has a white background and falls as a square.
Logged
Neferkitty 
« Reply #2 on: November 26, 2009, 12:25:41 PM »

Hi,

It sounds like it may be part of your CSS stylesheet, or possibly the images you're using are not transparent gifs. Could you please send me your Catster or Dogster ID so I can check out your page?
Logged

Nickolas 
~~~~
*
Posts: 28



View Profile WWW
« Reply #3 on: January 09, 2010, 03:52:02 PM »

 yay Unsure Confused Embarassed Shocked Smile Cool doh! love

Oh MY we can make our own! has the sky fallen...? what happened to chicken little I demand to know...! woof woof...really really you are showing us how to make our own falling objects, HOW KOOL is this. I hope I will be able to do it.
Are there any instruction that I can follow or go read before I start cropping away and trying this out because I do lots of stuff before I ever know what I am doing, now that I found out instructions sometimes come with stuff i started asking for it. i forget them a lot of the time and come back again later for more i hope that ok too.

 love and hugs,
Y'r pal,
Nickolas
Logged

Nickolas Woohoo
Nickolas 
~~~~
*
Posts: 28



View Profile WWW
« Reply #4 on: January 09, 2010, 04:03:03 PM »

 love Too Cute   Wagging Hearts

THANK YOU
I just am moved by your trust in me to make it work!

I still have to use it yet I want to do something for Christmas and now my mind is blank. Crying or Very sad

Nickolas


 
Logged

Nickolas Woohoo
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

© 2007-2010 Catster Codes
Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM