Ayrton <al***********@libero.it> wrote in message news:mn***********************@libero.it...
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[i].onmouseover=new Function("document.getElementById('optionTip').inn erHTML=optionHelp["+i+"];");
actions.options[i].onmouseout=function(){document.getElementById('op tionTip').innerHTML=' ';};
}
</SCRIPT>
</BODY>
</HTML>
--
Stephen Chalmers