Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:00

Word wrapping.


Poster: DaveFaris
Dated: Wednesday October 29 2003 - 23:21:20 GMT

is there a way to turn off word wrapping inside a button?

Also, is there a way to define the size of a button so that it won't change, even at the cost of other buttons scroll off the page? Ex. I have one button that I want to make 190 px across, even though the text in that button amounts to only a few px. I've marked the item with a "itemwidth=190" but if I resize the screen, the button shrinks anyway.

(If you want to see what I'm talking about, take a look at the site I'm working on at http://www.maatf.com/index3.htm and shrink the width of the window down. You'll see the first item on the horizontal menu bar ("What is MSMA?") change size. You'll also see the other buttons wrap.)

thanks for your assistance.


Poster: John
Dated: Thursday October 30 2003 - 3:51:09 GMT

I think it's the form. The menu doesn't start moving until the right edge of the window hits the text input. Can you try putting it in a sub just to see what happens?

BTW, current is RC19 and you're running RC17. You should update (things move fast around here). Also, please don't forget to paste your license number into your code.

Thanks.


Poster: DaveFaris
Dated: Thursday October 30 2003 - 3:56:57 GMT

happens even if the form is subbed.


Poster: kevin3442
Dated: Thursday October 30 2003 - 8:28:13 GMT

Hi Dave,

This'll be my second "I-can't-sleep-so-I'll-give-a-completely-long-winded-answer" topic of the night. ;)

The text wrapping occurs for two reasons: (1) You've used menuwidth="100%" in your Top mainmenu. So, in order to maintain 100% width, the menu will adjust itself as you narrow the window, until it has no more room to shrink. Part of the adjustment it to wrap text for multi-word menu items and increase the height of the menu. (2) The text, as you noted, isn't prevented from wrapping.

Quote:
is there a way to turn off word wrapping inside a button?

You can use html non-breaking spaces to prevent line breaks at certain spaces. So for your case
Code:
aI("text=What is MSMA?;...

would become
Code:
aI("text=What is MSMA?;...


Quote:
Also, is there a way to define the size of a button so that it won't change,

Again, I think the problem here is menuwidth="100%". If the menu item is wider than it needs to be to accomodate the text, then there will be a bunch of "white space" following the text. That white space will shrink as the menu adjusts its size to maintain 100% while the window narrows.

So what can you do? I have a couple of suggestions:

(1) Make "What is MSMA" part of the Left menu instead of part of the Top menu. Then use top= and left= in both main menus to exactly position the two menus. In other words, you can still make your Top menu go where you want it, even if the first item in it is "Home".

Or...

(2) The ol' dummy menu item approach... (a) Take menuwidth="100%" out of the Top menu. That way the none of the items should shrink if the user narrows the window. But you've lost the 100% span effect. (b) To regain the 100% effect, add a "dummy" item as the last item in the Top mainmenu, as follows:
Code:
aI("text= ;itemwidth=100%;onbgcolor=#FFFF00;pointer=default;");

That should make a blank, unresponsive menu item at the end of the main menu that extends the rest of the way across the screen. That item will shrink if the user narrows the window, but the other items won't! (c) With your style, you'll end up with a separator after your "Search" menu item; there is no separator there in your present setup. If that separator bugs you, there are various ways to remove it. For example, set the Search menu item's separator size to 0, like so:
Code:
aI("text=Search;showmenu=search;separatorsize=0;itemwidth=90");


Let us know how you make out. Hope that helps,

Kevin


Poster: DaveFaris
Dated: Thursday October 30 2003 - 13:44:39 GMT

Wow, Kevin. Thanks! Your suggestions worked like a charm. You saved me from pulling what's left of the rest of my hair out.

Thanks again.
Dave.


Poster: kevin3442
Dated: Thursday October 30 2003 - 16:15:34 GMT

Hi Dave,

DaveFaris wrote:
Your suggestions worked...

Glad you got it working :) . I had a look to see which suggestion you used. I realized that, in my late-night stupor, I suggested the wrong onbgcolor for the "dummy" menu item (it turns yellow right now). It really should be #288630, the same as your style's green offbgcolor, so that the background color does not change on mouseover, making it totally inactive from the user's point of view. Like so:
Code:
aI("text= ;itemwidth=100%;onbgcolor=#288630;pointer=default;");


Nice touch with the Search item by the way... "Mongo like!"

Kevin


Poster: DaveFaris
Dated: Thursday October 30 2003 - 16:47:09 GMT

Quote:
I suggested the wrong onbgcolor for the "dummy" menu item

Oops. That's ok. I would have caught that eventually ...

thanks. I spent about 2 hours trying to figure out why the search field insisted on taking up more vertical space than it needed. By surrounding it with <p> and </p>, though, I was able to tame it.

Thanks again.