PDA

View Full Version : Problem including Smart Folding Menu Tree into another html files.



littlered
03-05-2006, 04:23 PM
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:

<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>

jscheuer1
03-05-2006, 05:29 PM
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.

littlered
03-05-2006, 06:12 PM
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?

jscheuer1
03-05-2006, 06:21 PM
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.

Twey
03-05-2006, 06:33 PM
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.