473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

javascript for dropdown menu's with variable width

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 :-(
Jul 23 '05 #1
4 4936
Tim wrote:
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/ex...rop_down_menu/

Mike
Jul 23 '05 #2
Tim
mscir <ms***@yahoo.com> wrote in news:AuadnRp1XuliRD3fRVn-
vg@pghconnect.com:
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
Jul 23 '05 #3
Tim
mscir <ms***@yahoo.com> wrote in news:AuadnRp1XuliRD3fRVn-
vg@pghconnect.com:
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
Jul 23 '05 #4
Tim
mscir <ms***@yahoo.com> schreef op vr, 03 jun 2005 22:30:20 GMT in
news:Au********************@pghconnect.com:
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
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Mark Bram | last post by:
Hi All! Has anyone seen an example of the following javascript powered control: - a dropdown select menu - the width of the control is set. Assume by "control" I mean the visible part of the...
3
by: jimmygoogle | last post by:
I posted earlier with a scope problem. I think I resolved it in IE but in Firefox it still exists. Anyone have any ideas/experience with this? I attached my code sorry it is so long. You can...
6
by: nishac | last post by:
Can anyone suggest me how to make my drop down menu work in IE7 too.Its working in other browsers.On mouse over the submenus should be displayed.Am attaching my css code hereby.Anyone please check...
4
torquehero
by: torquehero | last post by:
Hi all :) I have created a horizontal navbar using Xara Menumaker. The Menu items have several dropdown menus. Its a javascript. When the mouse cursor is moved over any menu item, a dropdown...
1
by: Aad vd Naad | last post by:
Hi, I have create a dropdown menu which looks as expected in Safari (Mac). Viewing it in FF (Mac) or IE6 (Windows) it's a bit messed up. It also seems that when the top level links are clicked...
4
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
1
SHOverine
by: SHOverine | last post by:
Recently my web host decided to "upgrade". This change rendered many of my pages useless and I am scrambling to fix the issues, so you may see several posts from me in the coming days. My first...
19
by: Jim | last post by:
Hi, I have two questions/problems pertaining to CSS horizontal dropdown menus and am hoping that someone here can help me out. (1) I'm having a problem centering the menu. I picked up the...
0
by: nitinsingh1 | last post by:
Hi, I am using a PDA containing Windows Mobile 5.0 for my client application in JAVA (JSP & SERVLET).There i am using a dropdown menu on a page.There are 3 different values (A,B,C) in that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.