View Full Version : ddlevelsmenu - submenu not appearing below main (top) menu item on mouseover

01-09-2013, 04:13 PM

I have successfully implemented the ddlevelstopmenubar on about 30 pages for my html website, but on one of them, one of the submenu items (which has links to a third level of submenu items) does not appear below its main (top) menu item when the cursor hovers over that, but appears several inches away, at the top left corner of my webpage, where the user cannot access it. I'm using a template to create the pages, so all the information is the same except for content.

Can anyone tell me why this behavior is occurring and how to remedy it?

Thank you, in advance, for your help.

01-09-2013, 04:47 PM
We'd need a link to your problematic page and the DD script demo page to look at it properly.

01-09-2013, 06:33 PM
The issue occurs on mouseover at the "Software" top menu item.

Problem page: www.varisys.com/vs2007/media_.html
Working page: www.varisys.com/vs2007/mediamaya_.html

DDLevelsmenu script demo page: http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/index.htm

01-09-2013, 07:12 PM
I'm on iPhone at the mo but the menu on both pages functions/looks the same for me.

Which browser/OS are you using? Have you tested in other browsers to see if the same problem exists?

01-09-2013, 07:44 PM
It only appears to be a problem in IE 8 and less. I see that the template for the:

<!--HTML for the Drop Down Menus associated with Top Menu Bar-->
<!--They should be inserted OUTSIDE any element other than the BODY tag itself-->
<!--A good location would be the end of the page (right above "</BODY>")-->

is the same on both pages. But the way the script is interpreting it is different on the two pages. So that might have something to do with when the script is invoked, that might be different. But first let's take care of an obvious problem. All of the class="ddsubmenustyle" UL tags are invalid. For example the first one:

<ul id="WhatsNewSubMenu" class="ddsubmenustyle" text-align:left>

That highlighted section does nothing good and might be causing the problem. It should either be dropped, or made valid style:

<ul id="WhatsNewSubMenu" class="ddsubmenustyle" style="text-align:left;">

Either way, all 8 of them have that. It could be part of what's causing the problem. Fix them all and see.

The browser cache may need to be cleared and/or the page refreshed to see changes.

And additionally, since this is some kind of a template, the server cache might need to be cleared.

If it doesn't seem to work, leave the changes in place so I can have a look at it.

01-10-2013, 04:25 PM
Thanks, John. I've edited the text align code as you suggested, cleared the browser cache and refreshed the page, but the behavior has not changed. Do you think it might have to do with the setup J script code? I did not write it (obviously) and am not a Java developer yet. If you want to look at it, the URL is: http://www.varisys.com/vs2007/ddlevelsmenu.js

I don't know how to clear the server cache; can you tell me how to do that?

Appreciate your help.

01-10-2013, 06:12 PM
It's javascript, not Java. Two different things completely.

And no, it's the same javascript for both pages, right? There is some javascript (or perhaps css or markup, probably javascript) on the non-working page that is not on the working page. That's conflicting with the menu script, but only in IE 8 and less.

The way to diagnose it is to remove things one at a time from the non-working page until it starts working. It's always possible that there is more than one thing causing the conflict, but usually it's just one thing. Once we can find what's causing the problem, we can either remove it or find a way to keep it while preventing it from interfering. That's where the menu javascript might come in though, finding a way to change it so that it's not messed up by the other script.

For instance, the nonworking page has an onload and an onunload event. These are not present on the working page. They are both set to:

function() {try { if (o) { o(); } } catch (err) {} func(); }

And come from:

<a href="BIM_Software3DSMAX.html#3DSMAXDesign"><b>Click here to see the great features in this specialized version of 3D Studio MAX designed for the building industry!</b></a>

<h1>Media And Entertainment Suite</h1>
<script type='text/javascript' src='http://widgets.ziftsolutions.com/autodesk.ziftsolutions.com/js/8a7c9fef2ed5c0ba012eed9001af0967' charset='utf-8'></script>
<a name="Autodesk3dsMax"></a>

<h1>Autodesk 3ds Max</h1><a href="http://www.youtu

Try getting rid of that first. That might be the problem.

01-10-2013, 08:35 PM
Thanks, John.

I tried commenting out all the script other than the ddlevelsmenu script on the page, and the behavior is still occurring.
Any other ideas?

01-10-2013, 10:39 PM
I still cannot find the exact cause. It appears to be the markup. If I take out everything after the menu headers and leave just the sub menus at the end it works. I did discover that there is no closing </script> tag for the ddlevelsmenu.js tag and that the credit is missing. The credit is required, please restore it. Change:

<script type="text/javascript" src="http://www.varisys.com/vs2007/ddlevelsmenu.js">

<meta name="Varitronics Systems Website" content="Autodesk Software Promotions" />


<script type="text/javascript" src="http://www.varisys.com/vs2007/ddlevelsmenu.js">

* All Levels Navigational Menu- (c) Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

<meta name="Varitronics Systems Website" content="Autodesk Software Promotions" />

That won't fix it, but is required by DD terms of use:


What should fix it is if you can validate the HTML markup of the page. But it has tons of validation errors, so finding the one that's causing the problem would be difficult, especially since it's probably inherited from the template and might not be a validation error on its own, only when plugged into the rest of that particular page. I found a way to make it work though, even with the invalid markup. If you can change the template so that the sub menus are added right after the opening <body> tag instead of right before the closing </body> tag, that appears to fix it.

01-11-2013, 05:10 PM
THANK YOU! It finally works.

I'll add the credit to the rest of the pages and put the site into production.