Log in

View Full Version : Form script, mouse over in option menu



Drachsi
07-22-2008, 11:04 AM
Hi,

I have looked around for a script to work in my form. I have a drop down menu with 6 options. Is there a script that would provide a mouse over and show a small window with an image and text describing the selected item until the item is un-focused?

Regards

Drachsi

jscheuer1
07-22-2008, 11:26 AM
It would depend upon the drop down menu. If you mean a select element, there is no support for onmouseover of the options in IE 6 or 7. The specification calls for one though, so in FF (probably others) you can do it. But for the widest compatibility, just give your options a title attribute. This will work in all but IE 6:


<select name="bob">
<option value="">1</option>
<option value="">2</option>
<option value="">3</option>
<option value="" title="whatever">4</option>
</select>

If, on the other hand you have a menu script that contains elements like divisions and links, you could have a tool tip scripted onmouseover event for those items.

Drachsi
07-22-2008, 12:15 PM
Hi,

I have a standard drop down menu as
<option value="Double">Double</option> I created
<option value="Double" title="Double test">Double</option> That works.

I am trying to get the DD script http://www.dynamicdrive.com/dynamicindex5/balloontooltip.htm to work so that gives the information on mouse over.
Example: "rel="balloon1"

It would that this would a very useful solution for many forms.

Regards

Drachsi

jscheuer1
07-22-2008, 02:39 PM
I tried to explain, you can do that in FF and other conforming browsers, but it will not work in IE. Possibly this has been fixed in IE 8 which is supposed to be more conforming.

Now, even in FF, the Rich HTML Balloon Tooltip script is a bad fit for this because it uses the rel attribute, which isn't valid for the option tag, and is intended for use only with links. You would be better off with a script like:

http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip.htm

or:

http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm

Either of which allow you to add onmouseover and onmouseout events directly to the element (option tag in this case). Those are valid for option, but as I say, it simply will not work in IE 6 or 7.