Results 1 to 4 of 4

Thread: Animated Collapsible DIV - autoclose in x seconds

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

    Default Animated Collapsible DIV - autoclose in x seconds

    1) Script Title: Animated Collapsible DIV

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

    3) Describe problem:I found this post about this topic (here) but I am not sure how to tweak my code to make this work since the example is different than what my code looks like... I am not very familiar with Java Script but I can follow direction fairly well... If some one would be so kind as to help me undestand how to adjust my code to make the div close after 5 seconds... I have also used the altered version of the script that automatically expands the div on page load. found here

    Here is my Code:

    <div animatedcollapse.addDiv('expand','fade=1,height=115px,speed=800,hide=0') id="expand" style="height: 115px; widows:960px; display:none;">
    div content bla bla bla
    <a href="javascript:animatedcollapse.hide('expand')"><img src="/images/closebutton.gif" border="0" /></a>

    </div>

    Thanks in advance to anyone who would be willing to tell me how to get this div to automatically collapse after 5 seconds
    Last edited by jscheuer1; 09-21-2011 at 02:41 AM. Reason: typo

  2. #2
    Join Date
    Jul 2011
    Posts
    58
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default wrong section

    U have posted in wrong section
    see sticky notes

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

    Default

    Are you saying your code is different from the default version of the script (ie: you've modified the .js file)? If not, to auto close the default script after x seconds, you can use a function like the following:

    Code:
    <script>
    
    jQuery(function($){
    	setTimeout(function(){animatedcollapse.hide(['jason', 'kelly', 'michael'])}, 5000)
    })
    
    </script>
    In the above, the collapsible DIVs with IDs 'jason', 'kelly', and 'michael' will auto close after 5 seconds. Change the IDs to your own.
    DD Admin

  4. #4
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Awesome Thanks So much this WORKED! I really appreciate your 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
  •