PDA

View Full Version : BLM Multi Level Menu



Mminnig
01-18-2007, 05:47 PM
1) Script Title: BLM MultiLevel Menu

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex1/blmmenu/

3) Describe problem:
When the page first loads, all of the sub-menus are visible. Once all of the items on the page have fully loaded, they dissapear.

Sample:
http://www.kydex.com/test/company_presidentsmessage.asp

Is there any way to prevent this?

jscheuer1
01-20-2007, 05:33 AM
Probably several. The menu is designed to be useful without javascript enabled. That is why everything is visible before the script initializes. I didn't design this script but, I know that it doesn't have to be that way. My best guess for your menu (a horizontal one, right?) would be to put this script after the style links:


<script type="text/javascript">
if(document.getElementById)
document.write('<style type="text/css"> .horizontal li ul {display: none;} <\/style>');
</script>

That way, if javascript is present, the menus should be hidden at first without waiting for the script to load, and still be visible if javascript is disabled.

I'm not certain if this is the solution (as I said, my best guess) but, if it isn't, it just needs to be changed so as to apply the right style to the right selector.

blm126
02-05-2007, 04:36 PM
Sorry, I haven't been on the forums in a while. John's solution will work fine, but I just wanted to point out for anyone with the same problem that may find this thread that there is an easier solution. You just need to add "inaccesible" to the class portion of the top div. The css will pick it up and hide the sub menus right away. In the version on my site, this is now the default.

jscheuer1
02-05-2007, 05:06 PM
But, will that preserve the non-javascript enabled utility of the menu?

blm126
02-05-2007, 08:27 PM
But, will that preserve the non-javascript enabled utility of the menu?
It depends on which version. The version on DD, no. The way I have designed it, if javascript is turned off, then the submenus will still be hidden. That is why I had the feature turned off by default. So, in that regard your solution is better. However, in between when version on DD was written and when the new version was written, IE 7 was released. Since IE 7 allows :hover on all elements, I took advantage of this, and made the menu work completely without javascript(minus some advanced features). This allowed me to reverse the inacessible option into accessible, for those still worried about older browsers without javascript.

dmwhipp
02-13-2009, 06:35 PM
Just added your code to my page and it works perfectly! Thanks, I didn't know that issue could be resolved.

Do you know how I could style menu items that don't have hyperlinks? Here is my post with a site link and code: http://www.dynamicdrive.com/forums/showthread.php?t=41816
Thanks,
Deborah