Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default scriptaculous Effect Appear to just one div onload...

    Hey, well I'm using scriptaculous to make one of my divs appear when the page loads. It's making the div load, but it's also making the two divs below it load too... I don't want them to use effect appear, I want them to just load as normal and only have the one div load with the effect... here's my code.

    'container-fade' is the ID and class of the div I want to use the effect, the other two divs are just 'container'.

    Code:
    <script src="javascripts/prototype.js" type="text/javascript"></script>
    <script src="javascripts/scriptaculous.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
      // <![CDATA[
    window.onload = function () {
           new Effect.Appear('container-fade');
       }
      // ]]>
    </script>
    Div that I want to appear with effect
    Code:
    <div class="container-fade" id="container-fade" style="display:none">yo</div>
    Divs I want to load normally... (they're the same).

    Code:
    <div class="container" id="container"></div>
    I'm new to javascript, any help would be good.

  2. #2
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    the code you have put up should work... looks to me it might be the way you have structured the layout. Post up the whole HTML markup

  3. #3
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Edit: I've fixed it, thanks. I missed off a couple of </divs>
    Last edited by Hitman; 14-04-2009 at 07:33 PM.

  4. #4
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    Glad you got it fixed. Just in future, make sure you check the page structure (closed divs etc...) before moving onto integrating other aspects... as it can come back to haunt you.

Posting Permissions

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