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 6 of 6
  1. #1
    Join Date
    Jan 2007
    Posts
    4,664
    Tokens
    1,279

    Latest Awards:

    Lightbulb Click-to-Expand Content Box +REP!

    Hey all,

    i've been designing a new website recently for myself and this next I might need a little bit of help with so I thought i'd come and ask for your ideas on here.

    http://www.dynamicdrive.com/dynamici...edcollapse.htm I'm aiming for something like this but more visually enhanced and a little more complex.

    Here is the concept of what i'm trying to achieve:

    How it should appear on the page before being expanded:


    How it should appear after being clicked


    However, I don't want the clickable part to be an image itself, or even a visible link, I just would like it so that when the unexpanded bar is clicked in any place it will toggle the hidden content in the box below, which also needs to be expandable for the amount of content it can hold.

    Also hope to keep the gliding animation whilst it expands

    I hope its also not a problem getting the entire page to expand when the content box is activated, if its any help then its this page here: www.danrogerson.com/test1/portfolio.php

    Thanks for your help and +REP to those who deserve it.


  2. #2
    Join Date
    Apr 2010
    Location
    Newcastle
    Posts
    655
    Tokens
    50

    Default

    You mean like
    Code:
    <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js'></script>
    
    <div id='clickMeBar' style='background:#777;color:#FFF;'>
    Black blah blah, some stuff here<br />click on me.
    </div>
    
    <div id='pageContent' style='display:none;'>
    BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />
    </div>
    
    <script>$('#clickMeBar').click(function(){$('#pageContent').slideToggle('slow');});</script>
    Last edited by Apolva; 15-05-2010 at 05:54 PM.

  3. #3

    Default

    What do you mean?

  4. #4
    Join Date
    Jan 2007
    Posts
    4,664
    Tokens
    1,279

    Latest Awards:

    Default

    Quote Originally Posted by Apolva View Post
    You mean like
    Code:
    <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js'></script>
     
    <div id='clickMeBar' style='background:#777;color:#FFF;'>
    Black blah blah, some stuff here<br />click on me.
    </div>
     
    <div id='pageContent' style='display:none;'>
    BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />BLAH<br />
    </div>
     
    <script>$('#clickMeBar').click(function(){$('#pageContent').slideToggle('slow');});</script>

    Exactly that, thanks. But I just need to do it with the design slices..

    I put your example up here to see what it would do. http://danrogerson.com/test1/portfolioq.php works perfectly by the looks of it in FF and IE.


  5. #5
    Join Date
    Apr 2010
    Location
    Newcastle
    Posts
    655
    Tokens
    50

    Default

    Glad to help.

    You might want to look into the jQuery library documentation for future use as it can come in very handy.

    http://docs.jquery.com/Main_Page

  6. #6
    Join Date
    Jan 2007
    Posts
    4,664
    Tokens
    1,279

    Latest Awards:

    Default

    Brilliant!

    http://danrogerson.com/test1/portfolioq.php

    Looking great, ironed out the glitches in both browsers too. Will take a bit of maintaining for new content but that shouldn't be a problem. Sorry about the rep Apolva, says I need to spread.
    Last edited by Firehorse; 15-05-2010 at 09:31 PM.


Posting Permissions

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