A
Ayrton
I need to have tooltips in a select list (or combo ), are there some
examples ?
examples ?
Ayrton said:I need to have tooltips in a select list (or combo ), are there some
examples ?
Ayrton said:I need to have tooltips in a select list (or combo ), are there some
examples ?
None that I could find, other than by simulating a select box in CSS.
The following works in the Mozilla family only. In I.E. and Opera I could
not add mouseover events successfully to the option elements. Perhaps
someone else can.
<HTML>
<BODY>
<DIV ID='optionTip'> </DIV><BR>
<FORM name='f1'>
<SELECT name='actions'>
<OPTION value='moon'>Moon</OPTION>
<OPTION value='earth'>Earth</OPTION>
<OPTION value='mercury'>Mercury</OPTION>
</SELECT>
</FORM>
<SCRIPT type="text/javascript">
var optionHelp=['Pull the Moon out of orbit',
'Collide the Earth with Mars',
'Collide Mercury with Venus' ];
if(document.forms.f1.innerHTML)
with(document.forms.f1)
for(var i=0; i<actions.length; i++)
{
actions.options.onmouseover=new
Function("document.getElementById('optionTip').innerHTML=optionHelp["+i+"];");
actions.options.onmouseout=function(){document.getElementById('optionTip').innerHTML=' ';};
}
</SCRIPT>
</BODY>
</HTML>
Ayrton said:I've try your example, but the event mouseover don't fire when the
mouse il over an item of select.
My browser is IE 6.0
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.