Home » questions » Editing Javascript?

Editing Javascript?

2006-08-12 16:40:12, Category: Programming & Design
The below link is for a text file which contains a Javascript that is for "snowfall" which is really just "*" enlarged to look like snowflakes (see demo here: http://www.lissaexplains.com/snow2.html). I would like to know how to: 1) Make more than one kind of "snowletter" (i.e., have "x" and "o" for Valentine's, etc.) 2) Make the objects "fall" up instead of down. Both things need seperate code. If anyone could help me, I would really appreciate it. http://www.lissaexplains.com/snow2instructions.zip Sorry about the dead-end link. You can find the demo here: http://www.lissaexplains.com/javascript.shtml Also, the snowflakes are not pictures they are letters, asterisks (*) to be exact. I use both formats, but I wanted to configure this one because it is cross-browser and easier to edit (once you know what to edit :)

Answers

  1. Elizabeth K

    On 2006-08-15 10:12:19


    I don't know about the different kinds of characters. Possibly you could try separating them like this: "A","B","C". As far as the snow "falling" up, just add a negative value for the "sinkspeed": // Set the speed of sinking (recommended values range from 0.3 to 2) var sinkspeed=-0.6
  2. dinosf

    On 2006-08-12 16:50:18


    swap out the image snow.gif with the one you want to use in the statement var Snowflake = "snow.gif" near the top, use the same name. It would require the image be in the same folder as the javascript you can also modify the link such as "../Images/snow.gif" if it's in a different directory
  3. alexjewell@sbcglobal.net

    On 2006-08-12 17:11:36


    The size is here: // Set the maximal-size of your snowflaxes var snowmaxsize=22 // Set the minimal-size of your snowflaxes var snowminsize=8 That sets the biggest size snowflake you'll see, and the smallest. Now, if you want them all the same...well...make those two numbers the same. I don't see anything to change to make it change direction, but I see the place to make it change the area of the screen: // Set the snowing-zone // Set 1 for all-over-snowing, set 2 for left-side-snowing // Set 3 for center-snowing, set 4 for right-side-snowing var snowingzone=3 This script is written for a certain direction, and changing it would result in testing in all the browsers and formats again... basically... it would take totally rewriting the script. Hope this helps.