Show complete select box entry

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

    Show complete select box entry

    Hi,

    I use a select box with a fix width (via stylesheet).
    So some of the entries are cut on the right side if they're too long.
    Is there a way to display them complete like a tool tip on a mouseover?

    Thanks,
    Jens

  • Grant Wagner

    #2
    Re: Show complete select box entry

    Jens Riedel wrote:
    [color=blue]
    > Hi,
    >
    > I use a select box with a fix width (via stylesheet).
    > So some of the entries are cut on the right side if they're too long.
    > Is there a way to display them complete like a tool tip on a mouseover?
    >
    > Thanks,
    > Jens[/color]

    <select ... onmouseover="th is.title =
    this.options[this.selectedIn dex].text;">

    Works in Netscape 7, Mozilla and other Gecko-based browsers and Opera 7.
    It'd work in IE too if IE displayed the TITLE on <select> in a tooltip.

    I even tried the following in IE:

    <span id="testWrapper "><select ... onmouseover="th is.parentNode.t itle =
    this.options[this.selectedIn dex].text;">
    <!-- options -->
    </select></span>

    No joy. Probably caused by the fact that a <select> is a windows object
    that doesn't play well with other HTML elements <url:
    http://support.microsoft.com/default...b;en-us;177378 />

    --
    | Grant Wagner <gwagner@agrico reunited.com>

    * Client-side Javascript and Netscape 4 DOM Reference available at:
    *


    * Internet Explorer DOM Reference available at:
    *
    Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


    * Netscape 6/7 DOM Reference available at:
    * http://www.mozilla.org/docs/dom/domref/
    * Tips for upgrading JavaScript for Netscape 7 / Mozilla
    * http://www.mozilla.org/docs/web-deve...upgrade_2.html


    Comment

    • Ivo

      #3
      Re: Show complete select box entry

      > <select ... onmouseover="th is.title =[color=blue]
      > this.options[this.selectedIn dex].text;">
      > I even tried the following in IE:
      > <span id="testWrapper "><select ... onmouseover="th is.parentNode.t itle =
      > this.options[this.selectedIn dex].text;">
      > <!-- options -->
      > </select></span>
      >[/color]
      A workaround that I appear to be progressing with although I can not
      post example code atm, is to subtract the Yposition of the select list
      from the mouse Yposition, compare that to the selectedIndex to find
      which of the dropped down options is currently highlighted, then
      display a absolutely floating div NEXT to the select. You need to know
      the font height etc.etc.
      HTH
      Ivo

      Comment

      • Jens Riedel

        #4
        Re: Show complete select box entry

        Hi Grant,

        Grant Wagner wrote:

        [..][color=blue]
        > No joy. Probably caused by the fact that a <select> is a windows object
        > that doesn't play well with other HTML elements <url:
        > http://support.microsoft.com/default...b;en-us;177378 />[/color]

        Thanks for your hints, it works fine with Mozilla.

        Unfortunately IE is just the browser our customers use in 95% of all
        cases, so perhaps I have to try the workaround Ivo describes.

        Regards,
        Jens

        Comment

        • Jens Riedel

          #5
          Re: Show complete select box entry

          Ivo wrote:
          [color=blue]
          > A workaround that I appear to be progressing with although I can not
          > post example code atm, is to subtract the Yposition of the select list
          > from the mouse Yposition, compare that to the selectedIndex to find
          > which of the dropped down options is currently highlighted, then
          > display a absolutely floating div NEXT to the select. You need to know
          > the font height etc.etc.
          > HTH
          > Ivo[/color]

          Hi Ivo,

          thanks for this hint. If our customers can't be made to abstain from the
          tooltip, I'll try this...

          Regards,
          Jens

          Comment

          Working...