Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Snow Effect

  1. #11
    Join Date
    Nov 2017
    Posts
    8
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Thanks! it now does all i want

    I didnt manage to change the img src tho. Should i change it like this:

    fall.image2.src=fall.grphcs[2]="cl.gif" -> to fall.image2.src="snow.gif"

    and then change this src on alle the images you have. I tried this and it didnt work. Is it another way to do it?

    -August

  2. #12
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,375
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    You need to maintain the format of the code, the only thing you change are the images (highlighted):

    Code:
    fall.image0=new Image();
    fall.image0.src=fall.grphcs[0]="al.gif"
    fall.image1=new Image();
    fall.image1.src=fall.grphcs[1]="bl.gif"
    fall.image2=new Image();
    fall.image2.src=fall.grphcs[2]="cl.gif"
    fall.image3=new Image();
    fall.image3.src=fall.grphcs[3]="dl.gif"
    fall.image4=new Image();
    fall.image4.src=fall.grphcs[4]="el.gif"
    fall.image5=new Image();
    fall.image5.src=fall.grphcs[5]="fl.gif"
    You don't need to have so many of them, but you have to number them from 0. So, if you only have three, it would be:

    Code:
    fall.image0=new Image();
    fall.image0.src=fall.grphcs[0]="al.gif"
    fall.image1=new Image();
    fall.image1.src=fall.grphcs[1]="bl.gif"
    fall.image2=new Image();
    fall.image2.src=fall.grphcs[2]="cl.gif"
    You can use just one image, then it would be:

    Code:
    fall.image0=new Image();
    fall.image0.src=fall.grphcs[0]="al.gif"
    Or using your image:

    Code:
    fall.image0=new Image();
    fall.image0.src=fall.grphcs[0]="snow.gif"
    The current code has six images numbered 0 to 5. If you want more just add the next one numbered as 6, then the next as 7, and so on, however many you may want.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Augustab (11-08-2017)

  4. #13
    Join Date
    Nov 2017
    Posts
    8
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Hi again

    I tried that now, and im afraid i maybe did something wrong, at least it didnt work. The effect doesnt start when i change the images.

    When i go to the console to check for error-messages i get the "cannot set property '0' of undefined". And it says that this error is at line 19 and 139 in the javascript-file (which i now have made external - im linking to it). Line 19 and 139 are these two lines:

    Code:
    fall.image0.src=fall.grphcs[0]="snow.gif"
    and

    Code:
    window.fall_toggle = fall.toggle;
    I also get the fall_toggle is not defined error.

    I'll try some more tomorrow, have to stop now

    August

  5. #14
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,375
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    Can't be sure. But that sounds like you removed this line (highlighted):

    Code:
    // Pre-load your image(s) below!
    if(document.images){ // <-- Do Not Edit or remove this line!!!
    fall.grphcs=new Array()
    fall.image0=new Image();
    fall.image0.src=fall.grphcs[0]="snow.gif"
    If you post a link to your live page - if you have one, or can put up a demo somewhere that has the same problem and link to that, I can be of more help.
    Last edited by jscheuer1; 11-09-2017 at 06:48 PM. Reason: spelling
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Augustab (11-09-2017)

  7. #15
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,375
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    See also my previous post (14 in this series). But I already set it up how I think you want it, see:

    http://jscheuer1.com/demos/tidbits/f...ising-st-2.htm
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Augustab (11-09-2017)

  9. #16
    Join Date
    Nov 2017
    Posts
    8
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Your right, I had forgotten the array line

    It works perfectly now.

    Thanks for all the help, i think its done now

Similar Threads

  1. Snow Effect
    By NadiaAlbuquerque in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 06-26-2013, 05:02 PM
  2. Snow Effect
    By Metermaid in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 12-19-2012, 08:26 AM
  3. Snow Effect
    By hitcher in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 11-01-2005, 05:41 PM
  4. Snow Effect
    By Xposure in forum Dynamic Drive scripts help
    Replies: 9
    Last Post: 10-04-2005, 04:21 PM
  5. Snow Effect
    By irishcavan in forum Dynamic Drive scripts help
    Replies: 18
    Last Post: 09-23-2005, 01:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •