javascript for dropdown menu's with variable width

T

Tim

Hi,

I've been searching the web for hours now and found lots and lots of
javascript files with which you can create dropdown menu's, but with all
of them you have to specify the width of the menu-items.

This is not exactly to my liking because you have to set the width
according to the text in the menu-items. Now, when working width a fixed
font size, this goes fine, but that's not exactly what I want. If people
have the standard font size of their browser set bigger for some reason
(bad view, high resolution, etc...) then the menu-text has to been shown
bigger also.

So I'm looking for a js menu where the width is just determined by the
text that is in it. Does anyone know of a good dropdown menu script that
does it ?

Thanx in advance,
Tim

PS: not http://www.milonic.com/ though this one is good, it is not for
free for commercial use :-(
 
M

mscir

Tim said:
Hi,

I've been searching the web for hours now and found lots and lots of
javascript files with which you can create dropdown menu's, but with all
of them you have to specify the width of the menu-items.

This is not exactly to my liking because you have to set the width
according to the text in the menu-items. Now, when working width a fixed
font size, this goes fine, but that's not exactly what I want. If people
have the standard font size of their browser set bigger for some reason
(bad view, high resolution, etc...) then the menu-text has to been shown
bigger also.

So I'm looking for a js menu where the width is just determined by the
text that is in it. Does anyone know of a good dropdown menu script that
does it ?

Thanx in advance,
Tim

Suckerfish sets menu choice widths in em:

http://www.alistapart.com/articles/dropdowns/
http://www.htmldog.com/articles/suckerfish/example/

Also, based on suckerfish:

http://www.cssdrive.com/index.php/examples/exampleitem/css_drop_down_menu/

Mike
 
T

Tim

Suckerfish sets menu choice widths in em:

I had come across this one, but the widths must have been declared in px or
something, because all examples I found of this one didn't expand if the
font size of the browser was set higher. But indeed, the examples you gave
seem to work out just fine (except for the htmldog example because the bg-
image isn't wide enough, but I'm not intending to set a bg-image anyhow).

Thanx for your quick response! Hope I'll be able to implement and adjust it
to my needs. ;-)

Tim
 
T

Tim

Suckerfish sets menu choice widths in em:

hmmm, too bad this is just a two level menu :-( No submenu's for your
dropdown menu...

any other suggestions anyone?

greetz
Tim
 
T

Tim

Suckerfish sets menu choice widths in em:

I think I finally found a script that fits my needs. It can be found here:

<http://www.mojavelinux.com/projects/dommenu/>

No presetting the width, adjustable through css classes, endless submenu's,
....

You should really check this one out if you want a fully adjustable and
flexible dropdown menu!!!

The only ugly thing is the constructor of the menu. Everything has to be
included when initialising the menu which leads to almost unreadable code
that is quite susceptible to typing errors. Maybe, if I keep using it, I'll
write a code generator or adjust the classes so submenu's can be added
easily.

greetz
Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top