javascript for dropdown menu's with variable width

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim

    #1

    javascript for dropdown menu's with variable width

    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 :-(
  • mscir

    #2
    Re: javascript for dropdown menu's with variable width

    Tim wrote:
    [color=blue]
    > 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[/color]

    Suckerfish sets menu choice widths in em:

    http://www.alistapart.com/articles/dropdowns/


    Also, based on suckerfish:



    Mike

    Comment

    • Tim

      #3
      Re: javascript for dropdown menu's with variable width

      mscir <mscir@yahoo.co m> wrote in news:AuadnRp1Xu liRD3fRVn-
      vg@pghconnect.c om:
      [color=blue]
      > Suckerfish sets menu choice widths in em:[/color]

      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

      Comment

      • Tim

        #4
        Re: javascript for dropdown menu's with variable width

        mscir <mscir@yahoo.co m> wrote in news:AuadnRp1Xu liRD3fRVn-
        vg@pghconnect.c om:
        [color=blue]
        > Suckerfish sets menu choice widths in em:[/color]

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

        any other suggestions anyone?

        greetz
        Tim

        Comment

        • Tim

          #5
          Re: javascript for dropdown menu's with variable width

          mscir <mscir@yahoo.co m> schreef op vr, 03 jun 2005 22:30:20 GMT in
          news:AuadnRp1Xu liRD3fRVn-vg@pghconnect.c om:
          [color=blue]
          > Suckerfish sets menu choice widths in em:[/color]

          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

          Comment

          Working...