Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > select list

Reply
Thread Tools

select list

 
 
Ayrton
Guest
Posts: n/a
 
      07-30-2005
I need to have tooltips in a select list (or combo ), are there some
examples ?

--
Questa è una firma automatica di MesNews.
Sito: http://www.mesnews.net


 
Reply With Quote
 
 
 
 
Stephen Chalmers
Guest
Posts: n/a
 
      07-31-2005
Ayrton <> wrote in message news:...
> 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'>&nbsp;</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='&nbsp;';};
}

</SCRIPT>
</BODY>
</HTML>

--
Stephen Chalmers


 
Reply With Quote
 
 
 
 
Ayrton
Guest
Posts: n/a
 
      08-01-2005
Sembra che Stephen Chalmers abbia detto :
> Ayrton <> wrote in message
> news:...
>> 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'>&nbsp;</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='&nbsp;';};
> }
>
> </SCRIPT>
> </BODY>
> </HTML>


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


--
Questa è una firma automatica di MesNews.
Sito: http://www.mesnews.net


 
Reply With Quote
 
Stephen Chalmers
Guest
Posts: n/a
 
      08-01-2005
Ayrton <> wrote in message news:...
>
> 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


Which is quite consistent with what I said.
--
Stephen Chalmers


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select List transfer to another List with array richardsith Javascript 0 04-20-2012 09:10 PM
master select list changes contents of slave select lists Dan Thomas Ruby 0 02-02-2011 06:59 PM
to select random number from select list Pranjal Jain Ruby 3 04-10-2008 04:01 PM
Select List transfer to another List carrajo Javascript 5 02-17-2006 02:23 AM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57