Results 1 to 2 of 2

Thread: Accordion Expanding/Collapsing Issue

  1. #1
    Join Date
    Mar 2008
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Accordion Expanding/Collapsing Issue

    Greetings.

    I have a php page which dynamically creates divs for the accordion based off data from a xml document. The functionality of the accordion works perfectly on this page including the hyperlinks I added to expand and collapse certain headers.

    This page contains an iframe that links to information from a seperate html document. The problem I am having is trying to setup links in this external html document that will expand/collapse the headers from my main php page.

    It seems to me that since the js function(ddaccordion.toggleone) is initated from the html document, it tries to reference the header classes from within the html document.

    Is it possible to call the ddacordion.toggleone function from within an iframe but have it reference the css class information from my main php page?

    Thanks in advance for your reply.
    Ben

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

    Default

    Warning: Please include a link to the DD script in question in your post, in this case: http://www.dynamicdrive.com/dynamici...daccordion.htm . See this thread for the proper posting format when asking a question.

    Well, you're right that when you call something like:

    Code:
    <a href="#" onClick="ddaccordion.toggleone('mypets', 1); return false">Toggle 2nd header</a>
    "mypets" is assumed to be a CSS class on the page the link is contained in. If this link is in an IFRAME but the Accordion menu it manipulates is in the parent document, what you should instead is first to make sure the Accordion Menu is installed on your main parent document and properly initialized, then try to call it directly from the IFRAME page, something like:

    Code:
    <a href="#" onClick="parent.ddaccordion.toggleone('mypets', 1); return false">Toggle 2nd header</a>

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

    bluzynski (03-18-2008)

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
  •