PDA

View Full Version : How do a select with tooltip in IE?



javinski
01-30-2006, 12:30 PM
How do a select with tooltip in IE?

The attribute title in an option only works in Mozilla/Firefox.

Thanks.

12345c
01-30-2006, 03:18 PM
The tooltip cannot appear in IE because in him for displaying of tag SELECT objects which have been built-in in Windows are used. It is necessary to use other means, for example, calling tip on onmouseover. For example:
-----<span>
<select style=position:absolute;
onmouseover=document.all.s1.style.visibility='visible';
onmouseout=document.all.s1.style.visibility='hidden';
><option>fdsf</option></select>
<span id=s1 style=position:relative;top:-20;left:50;visibility:hidden;background:yellow;padding:4;>prompting</span>
</span>+++++++

javinski
01-30-2006, 04:24 PM
Thanks.

It's possible the same effect in every select's option? I think onmouseover is disabled in tag option.

Twey
01-30-2006, 05:37 PM
1) Keep your indentation style constant.
2) Never use document.all except as an IE test.
3) All attribute values must be surrounded with quotes, except when said value is a number; it's recommended even then.

-----<span>
<select
style="position:absolute;"
onmouseover="document.getElementById('s1').style.visibility='visible';"
onmouseout="document.getElementById('s1').style.visibility='hidden';"
>
<option>
fdsf
</option>
</select>
<span
id="s1"
style="
position: relative;
top: -20;
left: 50;
visibility: hidden;
background: yellow;
padding: 4;
"
>
prompting
</span>
</span>+++++++
javinski: Yes, it should be possible to use this code for every select. However, remember to use a different ID.
onmouseover cannot be disabled, in "tag option" or no.

javinski
01-30-2006, 06:40 PM
Sorry, my english isn't too good.
I want that every option of mySelect have onmouseover(or similar) but this event doesn't works in IE.

<select name="mySelect">
<option onmouseover="alert('hello1')">1111</option>
<option onmouseover="alert('hello2')">2222</option>
<option onmouseover="alert('hello3')">3333</option>
</select>

Thanks

Twey
01-30-2006, 07:40 PM
Sorry, my english isn't too good. No problem, but can you try to explain again what you mean by "tag option?"

javinski
01-31-2006, 08:21 AM
<select name="mySelect">
<option onmouseover="alert('hello1')">1111</option> --> First Tag Option
<option onmouseover="alert('hello2')">2222</option> --> Second Tag Option
<option onmouseover="alert('hello3')">3333</option> --> Third Tag Option
</select>

In IE don't exists the event onmouseover in the option, and i need a similar event that do the same.

Thanks for all.

Twey
01-31-2006, 04:22 PM
Ah, I see what you mean. This could be tricky.