I have my main menu in the header of Professional Theme. It is aligned right in the header and is multi-level. The problem is that when I drill down three levels deep, the menus start to shoot off the screen completely to the right to where you can't even see it anymore causing horizontal scroll bars and no way to click on the items in the menu. Is there an easy way to force the menu to stay on the screen and if it's close to the right edge, it flies out to the left instead of continuing off the screen to the right?

THANKS for any help on this.

Comments

mheinke’s picture

hmm,

but the 1st and 2nd levels are fine?

you are using version 1.8?

erichhaemmerle’s picture

Well the first level is in the header, when the second level drops down from the header it extends past the right side a little and there is a small bit of horizontal scroll, but when the third level flies out, you can't even see it. It's way off the screen to the right and there is a much bigger horizontal scroll. I just remembered that when I first floated the menu right, the menu dropped down and was actually getting cut off in the #wrapper itself because it was set to overflow:hidden. I got rid of the overflow:hidden and then the menu was able to extend beyond the wrapper, but then the problem started of the menu going all the way off the screen. And yes I am using 1.8.

mheinke’s picture

thats really strange.

let me look into it

mheinke’s picture

@erich93063

can you provide a screenshot?

thank you

erichhaemmerle’s picture

StatusFileSize
new313.79 KB

Here you go. So if you hover over "Clients" and then "Information Technology", that flyout will go off the screen and you will get a little horizontal scroll, but when you then hover over "Enterprise Applications" there is actually another flyout that should be there, but you can't even see it. The entire menu is off the right side of the screen and you can see the resulting horizontal scroll bar.

Thanks for looking into this. It can probably be fixed with some creative CSS or maybe jQuery, but I'm just not sure the best way to handle it.

mheinke’s picture

StatusFileSize
new58.2 KB

ok, i see the issue.

now the question is, what is the best way to solve it... im looking for design/input ideas :) because this effects normal menus as well that are on smaller screens.

see my screenshot

erichhaemmerle’s picture

Oh good that makes me feel a little better, that it wasn't something I screwed up customizing the template and you're seeing the same behavior. :-) So yeah, not sure. I tried messing with it yesterday, but couldn't get anything to work right.

mheinke’s picture

im not sure that i like having the menus drop the way they do...
but im not sure what would look best either.

hmmmm

it is a CSS overflow issue...im just not sure if we want to just let it overflow and force scrolling...which is lame

erichhaemmerle’s picture

Yeah I was tempted to use the Suckerfish module or something along those lines, but I really like the way you implemented the mobile version of the navigation and I didn't want to lose that.

mheinke’s picture

i really like that mobile menu too :) haha

thats actually an interesting thought. i need to research how other themes and menu modules handle multiple children...

mheinke’s picture

StatusFileSize
new94.38 KB

the bamboo theme just allows overflow.
that may be what i need to do as well.

mheinke’s picture

StatusFileSize
new0 bytes

here is a patch that allows the menu to break outside.

mheinke’s picture

also,
here is the changes that need to be in style.css:

line 336

#wrapper {
  position:relative;
  max-width:1132px;
  margin:0 auto;
  box-shadow:0 0 6px #999;
  background:#e9e9e9;
  /*overflow:hidden;*/ /* remove overflow rule to allow the menu to break outside the wrapper */

}

line 479

#main-menu li li a {
  min-width:150px;
  margin:0;
  background:#555;
  border-top:#5f5f5f 1px solid;
  font-size:13px;
  line-height:33px;
  text-align:left;
  overflow:auto; /*allow the menu to break outside the wrapper...this was set to hidden */
}
mheinke’s picture

StatusFileSize
new594 bytes
mheinke’s picture

Status: Active » Needs review
erichhaemmerle’s picture

Yeah actually I had already gotten rid of the overflow:hidden. That's what got me in this predicament in the first place. Initially, the menu was getting cutoff (hidden) by the right edge of the wrapper. When I got rid of the overflow, the menu would extend beyond the wrapper, but it would also extend beyond the SCREEN.

erichhaemmerle’s picture

So needless to say, I'm still in the same situation. arg. I'm tempted to tell the designers to just move the menu to the left instead of having it on the right. Something tells me we aren't gonna fix this quick.

mheinke’s picture

yea,
unfortunately im not certain i can not officially support your customization, as it would take re designing the menu.

luckily, in the stable release, the menu is working as intended and breaks as nessessary.

mheinke’s picture

Category: bug » task
Status: Needs review » Postponed
erichhaemmerle’s picture

So I ended up using some jQuery and it seems to be working fine. By default the drop-down will fly to the right, but if the drop-down would end up flying off the screen, it will fly to the left instead. I needed to add a border to the ul's though so when the dropdown menus start flying out you can tell what menu is what since they start overlapping. Thanks for your help on this though!!

$('#main-menu ul').not(':first').css('border', '1px solid grey');

$('#main-menu li').mouseenter(function() {
  $(this).children('ul').css('display', 'none').stop(true, true).slideToggle(250).css('display', 'block').children('ul').css('display', 'none');
  
  //make sure menu does not fly off the right of the screen
  if ($(this).children('ul').offset().left + 200 > $(window).width()) {       
    $(this).children('ul').css('right', 180);          
  } 
});
mheinke’s picture

it would be interesting to add this wrapped in a condition that checked if the menu was float:right;

glad you got this working :)

mheinke’s picture

Issue summary: View changes
Status: Postponed » Closed (fixed)