Results 1 to 3 of 3

Thread: Controlling the Height of the Snow Dynamicaly

  1. #1
    Join Date
    Jan 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Controlling the Height of the Snow Dynamicaly

    I'm working on something for my Church's website so that I can have certain weather effects during certain events (christmas, east, etc...). I decided to use this code as it shows up the best on my website and I am most happy with it.

    http://www.dynamicdrive.com/dynamicindex3/snow.htm

    My question is this: the website I'm wanting to put this on grows and shrinks so how can I make the height and width of this applet dynamic?

    Thank You,
    Zach

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Styles2304 View Post
    My question is this: the website I'm wanting to put this on grows and shrinks so how can I make the height and width of this applet dynamic?
    The same way? How does the site grow and shrink? There are many ways to have that happen. In any case, here (in the script's code) is where the snow img tags are written:

    Code:
    <img src='"+snowsrc+"' border=\"0\">
    This actually occurs in two places. You could add a class or inline style. What style you would add or what style properties/values you would give to that class and/or how you would manipulate it via script, would depend upon what method the page uses to shrink and grow.

    Whatever you add would need to follow the script's admittedly not too well though out syntax, and be placed in this bit of code both of the places where it appears in the script's code. For example, to add a class:

    Code:
    <img class='somename' src='"+snowsrc+"' border=\"0\">
    Note the use of the single, in place of the usual double quotes. Or you could use escaped double quotes, as is already done in the code for the border attribute.
    - John
    ________________________

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

  3. #3
    Join Date
    Jan 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I just ended up going with:

    Code:
      var i, doc_width = document.body.scrollWidth, doc_height = document.body.scrollHeight;
    That seemed to solve all my problems . . . thanks for the input though!

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
  •