I've implementedthe gigamenu module on my web site (www.manchesternewsguild.org) and have it running my primary menu. I'm still styling it, so it's not quite pretty, but have had to stop to deal with the following: As the page loads, the entire, expanded gigamenu "flashes" open until the page finishes loading and then hides itself. A little research elsewhere indicates it's a javascript issue that can be fixed by changing the css for the menu to display:hidden, which hides the expanded menu during page load in browsers with javascript enabled, but still works when you hover on the menu after that. I tried that by adding the css html.js #gigamenu ul li { display: none; } to my style.css. That hides the menu during the page load, but the upon hovering, only the level 1 children show in the gigamenu, rather than all of the items below that, even upon hover over the level 1 links. I must be missing something, but can't figure it out. Does anyone have any clues?

Comments

hrpr.com’s picture

I got rid of the flashes and am able to display the level 2 children by adding the following:

ul.gigamenu li ul { display:none; }

ul.gigamenu li li ul { display:block; }

Unfortunately, I cannot provide a demo as I'm doing this on a test site behind my firewall. But here is a current copy of the css I'm using:

/* Override Garland styles */
#header-region .gigamenu-wrapper * {
  display:  block;
}
#header-region ul.gigamenu li {
  margin: 0;
}

ul.gigamenu li ul {
  z-index: 999;
  width: /*750px;*/ 400px;
  padding: 1em;
  margin: 0;
  background:/* #ddd;*/ #9babbc;
  position: absolute;
  display:none;
}
ul.gigamenu li li.gigamenu-level-1 {
  float: left;
}
ul.gigamenu li li ul {
  padding: 0 0 1em 0;
  margin: 0;
  /* Reset style from megamenu wrapper ul */
  width: /*250px;*/ 150px;
  background: none;
  position: relative;
  display: block;
}
ul.gigamenu li li a {
  font-size: 1.2em;
  color: /* black; */ #00005a;
}
ul.gigamenu li li li a {
  font-size: 1em;
  color: inherit;
}
ul.gigamenu li li li ul {
  padding: 0 0 .5em .5em;
}
ul.gigamenu li li li li a {
  font-size: .9em;
}

/* Horizontal menus */
.gigamenu-horizontal ul.gigamenu li.gigamenu-level-0 {
  float: left;
}
.gigamenu-horizontal ul.gigamenu li.gigamenu-level-0 a {
  padding-right: 1em;
}

/* Vertical menus */
.gigamenu-vertical ul.gigamenu li.gigamenu-level-0 {
  width: 10em;
}
.gigamenu-vertical ul.gigamenu ul {
  margin: -1em 0 0 10em;
}
.gigamenu-vertical ul.gigamenu ul ul {
  margin: 0;
}
ManchesterNewsGuild’s picture

Thanks, hrpr.com. That code did the trick. I've got the menus working and am styling them in my spare time.

Bret74’s picture

Hi, I'm looking for such a module, and thanks to try for me ;-)
Just a small point : Your gigamenu doesn't seem to work with GoogleChrome (nothing happens on hover). But it's ok on IE6, Firefox and Safari.
(With http://gigamenu.clients.codepositive.com, I can see the gigamenu but it's not readable)
Bye.

talatnat’s picture

With Google Chrome 8.0.552.224 for Ubuntu it works fine for me, including the Giga Menu demo.

escoles’s picture

Confirming that fix @ #1 works in Firefox and Chrome on my Mac.

Currently the output code for the subnav elements read like this:

<ul style="display: none;" class="gigamenu menu">

I suspect the flashing problem would go away without a stylesheet workaround if it read like this instead:

<ul style="display: none; visibility: hidden;" class="gigamenu menu">

doublejosh’s picture

Believe the issue is that the display:none; is added via Javascript natively in the module.

Adding display:none; in your CSS stylesheet certainly *helps* the issue, but doesn't completely solve it (depending on your setup) because the stylesheet still has to load. If you place it high-up in your aggregated CSS file (via performance) by placing it in one of the first stylesheets within your theme, then it's likely to happen before a person ever sees it.

The *best* way to do this is add it to the HTML that's rendered in the first place, which the module does not do from what I saw... though I patched it to do so.

escoles’s picture

You're correct that adding explicit CSS doesn't solve the issue.

I haven't looked yet -- does the module allow for a theme override of the function that writes the menu code? Would be nice not to have to hack the module.

doublejosh’s picture

StatusFileSize
new500 bytes

Here is a patch to have submenus display:none initially in the HTML rendering.

doublejosh’s picture

Status: Active » Needs review

Works for folks?

escoles’s picture

Getting this error after patch:

warning: Missing argument 2 for theme_gigamenu_menu_tree() in /home/memryadm/public_html/_dev/sites/all/modules/gigamenu/gigamenu.module on line 156.

doublejosh’s picture

Sorry, I must not have the newest version of the module. Looks like there is another argument in there now.

Will rework.

doublejosh’s picture

StatusFileSize
new696 bytes

Actually just looks like I messed up while I was creating the patch. Missed adding the argument to the initial function call.
Sorry, I'm working on a few changes to this module and trying to keep the branches separate as separate patches.
Here ya go.

doublejosh’s picture

StatusFileSize
new704 bytes

... and a re-run for coding standards with spacing.

escoles’s picture

Thanks, josh. seems to be working like a charm. my php is rusty and wasn't great to begin with, so it would have been a fair amount of trial & error to get the original argument right.

doublejosh’s picture

Good good. Using on my site too.

doublejosh’s picture

Committable?