Results 1 to 3 of 3

Thread: Collapsible DIV's question

  1. #1
    Join Date
    Sep 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Collapsible DIV's question

    1) Script Title: Animated Collapsible DIV

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...edcollapse.htm

    3) Describe problem: The div's on my site are changed dynamically after the page has loaded. The content of the divs to be expanded is changed using innerHTML commands after some user input. This results in divs with heights different than their original value on the page load. So when I try to expand the div (after its been modified), it only expands to show half of the content. Is there any way to "tell" the Animated Collapse script the new height of the div so that it expands it properly?

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

  3. #3
    Join Date
    Sep 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks for pointing me in the right direction!

    i wanted something a little different... i didn't want the new div contents to be displayed right away, so i came up with a little "hack" that would look something like this if you modified the example on the link above:

    Code:
    function test(){
    document.getElementById('dog').innerHTML='<p>d<p>d<p>d<p>d<p>d<p>d<p>d<p>d<p>d'
    document.getElementById('dog').style.height="500px"
    collapse1.contentheight=500
    collapse1.timelength = 0
    collapse1.slideup()
    collapse1.timelength = 1000;
    collapse1.slidedown()
    return false
    }
    basically it slides up the new content as soon as it is displayed with a timelength of 0 (so it happens instantly), and then readjusts the timelength and slides in down again normally.

    thanks again for the help!

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
  •