Show complete select box entry

J

Jens Riedel

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
 
G

Grant Wagner

Jens said:
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

<select ... onmouseover="this.title =
this.options[this.selectedIndex].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="this.parentNode.title =
this.options[this.selectedIndex].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.aspx?scid=kb;en-us;177378 />

--
| Grant Wagner <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp

* 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-developer/upgrade_2.html
 
I

Ivo

<select ... onmouseover="this.title =
this.options[this.selectedIndex].text;">
I even tried the following in IE:
<span id="testWrapper"><select ... onmouseover="this.parentNode.title =
this.options[this.selectedIndex].text;">
<!-- options -->
</select></span>
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
 
J

Jens Riedel

Ivo said:
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

Hi Ivo,

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

Regards,
Jens
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,093
Messages
2,570,607
Members
47,227
Latest member
bluerose1

Latest Threads

Top