Anyway to enable a ToolTip for each ListItem

Discussion in 'ASP .Net Web Controls' started by Chris Bates, Jun 22, 2006.

  1. Chris Bates

    Chris Bates Guest

    Is there anyway to enable a tooltip for each item in a listbox ?
    Chris Bates, Jun 22, 2006
    #1
    1. Advertising

  2. hi Chris, cant be done, this is a limitation of the option element itself.
    It does not support a title attribute. You will need to resort to javascript
    again and use the onmouseover event of the select element and check the
    event.RelatedTarget for non IE browsers and window.event.toElement for IE
    only, to check on what item of the select element you moused over and take
    action by setting the title of the select element based on what option item
    you have moused on.
    Its cake, depending on how knowledgable you are with javascript.
    good luck,
    Alessandro Zifiglio
    "Chris Bates" <> ha scritto nel
    messaggio news:...
    > Is there anyway to enable a tooltip for each item in a listbox ?
    Alessandro Zifiglio, Jun 23, 2006
    #2
    1. Advertising

  3. Also, now that i think about it a bit longer, setting the title of the
    select element might not be convenient and work the way you want it. You are
    looking at creating a custom tooltip, eg. An absolutely positioned div
    element, whose contents are the title that you want to set when the
    onmouseover of the select element fires.
    Regards,
    Alessandro Zifiglio
    "Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-m> ha scritto
    nel messaggio news:%...
    > hi Chris, cant be done, this is a limitation of the option element itself.
    > It does not support a title attribute. You will need to resort to
    > javascript again and use the onmouseover event of the select element and
    > check the event.RelatedTarget for non IE browsers and
    > window.event.toElement for IE only, to check on what item of the select
    > element you moused over and take action by setting the title of the select
    > element based on what option item you have moused on.
    > Its cake, depending on how knowledgable you are with javascript.
    > good luck,
    > Alessandro Zifiglio
    > "Chris Bates" <> ha scritto nel
    > messaggio news:...
    >> Is there anyway to enable a tooltip for each item in a listbox ?

    >
    >
    Alessandro Zifiglio, Jun 23, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    2,161
    Stefano Mostarda
    Feb 12, 2004
  2. Mad Scientist Jr
    Replies:
    2
    Views:
    429
    Mad Scientist Jr
    Jun 29, 2004
  3. Jim in Arizona
    Replies:
    7
    Views:
    899
    Badass Scotsman
    Nov 22, 2006
  4. Radu
    Replies:
    1
    Views:
    526
    Bruce Barker
    Jan 8, 2007
  5. Jimmy [Used-Disks]

    CheckBoxList: Adding onclick javascript event to each ListItem.

    Jimmy [Used-Disks], Nov 24, 2003, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    697
    Jimmy [Used-Disks]
    Dec 10, 2003
Loading...

Share This Page