Results 1 to 5 of 5

Thread: group toggle display

  1. #1
    Join Date
    Sep 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default group toggle display

    1) Script Title: Animated Collapsible DIV v2.4

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

    3) Describe problem: Toggle a group

    Hi,
    I know you can show or hide multiple div with something like that:
    Code:
    <a href="javascript:animatedcollapse.hide(['div1', 'div2', 'div3',...])>
    but

    Code:
    <a href="javascript:animatedcollapse.toggle(['div1', 'div2', 'div3',...])>
    doesnt work.

    How can you toggle display a group, or multiple divs ?
    Thank you !!

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

    Default

    There's no prebuilt function to toggle multiple DIVs at once. You can, however, just create a custom loop yourself to do this, ie:

    Code:
    <script type="text/javascript">
    
    function togglemultiple(divids){
    	if (typeof divids=="object"){
    		for (var i=0; i<divids.length; i++)
    			animatedcollapse.toggle(divids[i])
    	}
    	else
    		animatedcollapse.toggle(divids)
    
    }
    
    </script>
    Then:

    Code:
    <a href="javascript:animatedcollapse.togglemultiple(['div1', 'div2', 'div3',...])>
    DD Admin

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

    Default Doesnt work

    thank you but it doesn't work.
    Firebug says animatedcollapse.togglemultiple is not a function

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

    Default

    Ah yes, the second code should be:

    Code:
    <a href="javascript:togglemultiple(['div1', 'div2', 'div3',...])>
    DD Admin

  5. #5
    Join Date
    Sep 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Its works nice!

    thank you for support

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
  •