Forum Moderators: open

Message Too Old, No Replies

Tooltip with other Mouse Effects

         

th1chsn

4:19 pm on Sep 1, 2004 (gmt 0)

10+ Year Member



Hello, I am setting up a navigation bar and I was wondering if there was a way for me to include a tooltip in addition to the mouse effects that I currently have setup. I just want the user to be able to know what the link is when they click and hover over it.

Here is what I have so far:

<a href="?m=admin"
onMouseOver="document.images['Admin'].src='images/nav_Admin_over.jpg'"
onMouseOut=" document.images['Admin'].src='images/nav_Admin_up.jpg'" onMouseDown="document.images['Admin'].src='images/nav_Admin_down.jpg'"
onMouseUp=" document.images['Admin'].src='images/nav_Admin_up.jpg'">
<img width="47" height="40" border="0" src="images/nav_Admin_up.jpg" name="Admin" id="Admin">
</a>

TIA

StupidScript

11:08 pm on Sep 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could use the ALT attribute in the IMG tag, or use the TITLE attribute in the A tag:

<a href="..." title="Here is a ToolTip"><img src="..." alt="Here is a ToolTip"></a>

They should both be the same text, as different browsers will give precedence to different attributes.

th1chsn

7:23 pm on Sep 2, 2004 (gmt 0)

10+ Year Member



Thanks! That works perfectly.

mincklerstraat

10:34 am on Sep 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



According to the w3c spec, iiac, 'alt' tags shouldn't display 'tool tips', and are there in case the image is incaccessible for whatever reason (bad vision, or doesn't d/l). Web standards compliant browsers don't tend to show alt tags as tool tips, but only show title tags as tool tips - and ie does show alt tags as tool tips. This is a problem, since it has dissuaded some companies from using alt tags on images, since the duplicate text could confuse users or distract from the aesthetic effect. I always use alt tags anyways, the accessibility argument wins for me.