Link to home
Start Free TrialLog in
Avatar of Ilalove
Ilalove

asked on

Labels on drop down menus?

If add the ALT tag when an user mouse over an image he can view a little label with the content setted in the alt tag: <IMG ID="Picture7" height=33 width=143 SRC="Images/a_buttonlGUID.gif" BORDER=0 ALT="Guida">

I would like to know if it is possible to let a similar label appearing when the user mouse over on the selected element of a drop down menu.

Thank you.
Regards
Avatar of DreamMaster
DreamMaster

You mean like a select box? Or a javascript generated dropdown?

Cause as far as I know there is no way to get anything like the ALT tag on the select box...

For any text items...you could use the title property...

Max.
You should resolve your old open questions (some with urgent in the title) before you ask more questions.  You may find that experts make you wait as long for a response as you have made them wait for resolution of your open Qs.

Drop down menu?  Expanding collapsing table or select?

Cd&
Avatar of Ilalove

ASKER

COBOLdinosaur if I didn't close some of my previous question this was because the proposed solutions not satisfied me. But I will follow your advice and I will delete them.
Okay, now wahat about the drop down? Is it a select?

Cd&
Avatar of Ilalove

ASKER

Yes dear COBOLdinosaur it is a select
Well like I said (and correct me Cd& if I'm wrong) as far as I know there is no way to show Alt text information on selectbox items...

Max.
Okay then you are pretty limited. The tool tips have to fire off of a
mouseover.  The option doesn't support that.  You can put a tooltip up
for mouse over on the select, but not the individual items.  The HTML
standard actually specifies support for a mouseover event on the option
but neither IE or Netscrape have implemented it.

Cd&
Avatar of Ilalove

ASKER

Dear Cobol I need to have that "label" ONLY on the first selected option...
Avatar of Ilalove

ASKER

Dear Cobol I need to have that "label" ONLY on the first selected option...
I think I can get that.  Have to experimnet a little be back shortly.

Cd&
Avatar of Ilalove

ASKER

I deposit here other 200 points ONLY for you: I will give these points only yo you because I know you are one of the most skilled person in EE on these topics.
Just a thing: this is very urgent x me.
Duh....why would he be on nr1 otherwise....

Geez...sorry but this sounds like a lot of drooling going on here.....

Max.
ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the A, but there is still more to do on it.  I post the improved version a little later.

Cd&
Well, this is not the perfect tool tips but I think it is the best way to
simulate tool tips for a select.  Something the can't be done for real.

This second version offers different approach the tip box stays in a static
position instead of tracking the cursor. that avoids the problem of dragging
under the select.  Now way to get the tip on top I even tried using a iframe
for the tip. The movement can be used by using the mousemove event, but it
is really wonky.

The positioning of the tip box is still base on cursor position during focus
and can be adjusted by changing the offsets.

The added feature in this version is the dynamic text in the tip.  An array
is used to change the text based on the selected option.

Any combination of features from the two is possible, and there are probably
additional effects possible with the use of various combinations of events.

There is no way t d any of this in Netscrap 4.x. It is possible it could be
at least partly implemented in NS6, but i have not played much with 6, so
I don't what is really possible.

Cd&



<html>
<head>
<title>Changing Font Styles</title>

<script language="JavaScript">
<!--
var tips = new Array(5);
tips[0]="this is the default text";
tips[1]="this is text for the first selection option";
tips[2]="tip for the second option";
tips[3]="all your bases are belong to us";
tips[4]="final tip";

var TRAP=false;
var CURREL=false;
var thepos=0;
function trap()
{
   if (TRAP)
   {
      dragEvnt()
   }
   else
   {
   TRAP=window.event;
   trapx=TRAP.x+15;
   trapy=TRAP.y+15;
   dragEvnt();
   }
}
function dragEvnt()
{
if (TRAP)
{
CURREL.style.top=trapy;
CURREL.style.left=trapx;
CURREL.style.visibility="visible";
}
}
function hideit()
{
   TRAP=false;
   CURREL.style.visibility="hidden";
}
//-->
</script>

</head>
<body onLoad="CURREL=document.all['tooltip'];CURREL.innerHTML=tips[0]">
<form name="fonts">
<table border=1>
<tr><td>
<select name="fontSel" onFocus="trap()" onBlur="hideit()"
   onChange="CURREL.innerHTML=tips[this.selectedIndex+1]">
<option title="one" value="times" > select face
<option value="Times"> Times
<option value="Arial">  Arial
<option value="Courier"> Courier
</select>
</td>
</tr>
</table>
</form>
<div id="tooltip" style="background-color:lightyellow;color:black;width:150;
border:1px solid black;visibility:hidden;width:175;z-index:10;position:absolute">
&nbsp;
</div>
</body>
</html>


Ilalove,
It's very good of you to trust certain people, however, being NOT the number #1 in a topic area does not always mean that the expert is NOT 100% perfect. It would be appreciated by other experts if you also listen to their comments and provide additional input.

Reading this question it seems as if COBOLdinosaur did provide you with the best possible answer, but you did not listen to the other experts. Listening to other experts might give you additional information about the question you have / had. It is, of course, up to you to decide what to do.

RedCCameleon,
EE moderator