Tooltips on Listbox items

Not sure if this can be done, but figured I'd ask...

I have several small listboxes that occasionally have very long items in them Thus, you can't see more than the first portion of each item. What I'd like to do is add some javascript such that, when you hover over a given item in the listbox, it shows a "tooltip" of the entire listitem. Can this be done?
LVL 8
toddhdAsked:
Who is Participating?
 
devicConnect With a Mentor Commented:
no, this can not be done. Maybe change your design ;)
0
 
devicCommented:
here some idea, maybe it helps you:
-----------------------------------------------
<script>
function runit(obj)
{
      with(obj.style)
      {
            left=obj.offsetLeft;
            top=obj.offsetTop;
            width="500px"
            position="absolute";
            
      }
      obj.size=5;
      obj.onmouseout=function()
      {
            with(this.style)
            {
                  position="";
                  width=100;
            }
            this.size=1;
      }
      obj.onclick=obj.onmouseout;
}
</script>

<select style="width:100px" onmouseover="runit(this)">
      <option>I have several small listboxes that occasionally have very long items in them
      <option>Thus, you can't see more than the first portion of each item.
      <option>What I'd like to do is add some javascript such that,
      <option>when you hover over a given item in the listbox
      <option>it shows a "tooltip" of the entire listitem. Can this be done?
</select>
<input value=kuku><br>
<input value=kuku><input value=kuku><br>
0
 
SnowFlakeCommented:
do you want to have that tooltip before the item is selected ?
or would some form of tooltip after selection will also do ?
0
 
SnowFlakeCommented:
I just wander why would you accept an answer that says "no, this can not be done"
while ignoring my Q ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.