Results 1 to 5 of 5

Thread: Problem including Smart Folding Menu Tree into another html files.

  1. #1
    Join Date
    Mar 2006
    Location
    Lopburi, Thailand
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem including Smart Folding Menu Tree into another html files.

    Smart Folding Menu Tree Script
    http://www.dynamicdrive.com/dynamicindex1/navigate1.htm

    Hi,

    I'm developing a site and have been trying to get this script works for the site. I put all the Smart Folding Menu Tree codes in one html file - suppose that the name was menu.html - then, I open menu.html on IE, and it works just fine. But when I include it in another html file, say, content.html using SSI tag <!--#include virtual="menu.html" --> a problem occur. Everything looks fine except that I can't click on my folder image to open the submenu. The submenu will be open only when I click on the text of the folder.

    I also try putting all the menu codes in the content.html file, but the problem remains. I'm curious if the problem happened because all the codes are in a <td> tag. Is there any problem using these codes in a table?

    Here's what my content.html looks like around my folding menu tree codes:
    Code:
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="230" valign="top" background="../../../images/left_bg.jpg"><br>
    <!--#include virtual="../menu.html" -->
    </td>
    </tr>
    </table>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The first thing to do is test that it would work if you didn't use the include. Do this by replacing:

    <!--#include virtual="../menu.html" -->

    with the exact contents of the menu.html file.

    If that solves the problem I'm not sure how to proceed, if not, then the problem is likely that since a portion of the script belongs in the head of the page, you need a separate include for that part in the head of content.html. Or, since that part is script and style, those may be able to be linked externally in the usual manner for external style (in the case of the style) and in the manner of external scripts (in the case of the external script).

    There may be a problem with includes that read the DOM of the page in that the DOM elements they read may not be loaded at the time they try to read them.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2006
    Location
    Lopburi, Thailand
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the quick reply, John.

    Your answer gives me some ideas, especially those DOM things. Turns out that the problem is with the flash file included at the top of the page. I just remove it and the menu works just fine!

    But, the flash file is a must. So, what can I do about this??? T_T

    Any suggestions?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It may be that the flash code slows the loading of the page enough to make one or more of the issues I mentioned before come into play. Flash file at the top of the page is ambiguous. Without seeing the entire page, it would be hard to say anything for sure. The test I mentioned and possible resolutions still apply. It could just be that the flash file is making this apparent on a fast connection, something that, even without the flash, might happen on dial-up.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    But, the flash file is a must.
    As it requires a plugin, Flash should never be necessary to the function of a page. You need to provide an alternative.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •