Results 1 to 6 of 6

Thread: Accordion Content - Number Of 'Pets'?

  1. #1
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Accordion Content - Number Of 'Pets'?

    Accordion Content 1.5.1

    http://www.dynamicdrive.com/dynamici...daccordion.htm

    Is the ddaccordion.expandone function really limited to 5 headers? Because I want 30.



    ie: I can only get this to work for values of "X" of 0-4

    <a href="#" onClick="ddaccordion.expandone('mypets', X); return false" class="bodylink">

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

    Default

    There's no limit to the number of contents you can have in an Accordion Content instance. Please post a link to the page on your site that contains the problematic script so we can check it out.

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    MattyBumBum (07-08-2008)

  4. #3
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Oh, OK.


    http://mjrcreative.com/als/faq.htm


    (Please note: I've removed Example 2 entirely and placed the init in its own external file, Templates/ddaccordionbit.js)


    Ah, I see now I've uploaded it NONE of them work...

    Ah, OK, if I set up 15, only the first 5 work - if I set up 20, none work - if I set up 10, 10 work - or something...?
    Last edited by MattyBumBum; 07-08-2008 at 12:13 PM. Reason: Now seen it uploaded.

  5. #4
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Nothing yet chaps? Have I accidentally committed a no-no, or merely confused the issue?

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

    Default

    A couple of implementation errors I see, looking at your source. Firstly, a lot of your headers/content pair look like the following:

    Code:
                <b><a href="#" onClick="ddaccordion.expandone('mypets', 01); return false" class="bodylink">How 
                long does the carpet cleaning process take?</a></b> 
                <div class="thepet"> We are able to clean approximately 200 square 
                  feet per hour. This can vary slightly depending upon the amount 
                  of soil, how much furniture needs to be moved, specialty spotting 
                  procedures, and set-up time. </div>
    The 2nd parameter within ddaccordion.expandone('mypets', 01) should be a straight integer, not prefixed with "0". Secondly, what you have with the above HTML chunk are accordion contents (with CSS class "thepet"), but no corresponding header (with CSS class "mypets"). This is problematic in that you have now more accordion contents on the page total than you have headers. You should always have an equal number of the two on the page. That's not to say you can't have arbitrary links on the page that expand a particular accordion content, but in that case, you shouldn't be adding an accordion content beneath that arbitrary link as you have now.

  7. #6
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Aha! Thank you very much. As you can see, I have used your answer to force my result in perhaps the least elegant way possible, ie: by simply adding <span class="mypets"> </span> to the end of each of my anchors. I think I can hear you turning in your grave, but thanks again!

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
  •