admin管理员组

文章数量:1357583

Is there anyway to get the alt tag to display quicker?

Also, I notice it doesn't show in all browsers. I know I should craft a javascript tooltip but I am looking for something really lite with minimal code.

Is there anyway to get the alt tag to display quicker?

Also, I notice it doesn't show in all browsers. I know I should craft a javascript tooltip but I am looking for something really lite with minimal code.

Share Improve this question asked Mar 22, 2010 at 16:30 DkongDkong 2,78812 gold badges54 silver badges74 bronze badges 3
  • 4 alt is an attribute, not a tag. For a tooltip, you should use the title attribute. – SLaks Commented Mar 22, 2010 at 16:32
  • 2 There's nothing in the spec for alt attributes to be displayed as tooltips—it just so happens that IE displays them that way. The title attribute is probably what you want. – Will Commented Mar 22, 2010 at 16:33
  • To add to this: Think alt means alternative. In other words, if the img doesn't load or my users can't see it (sight-impaired users), what Alternative text do I want to display? If it's a graphic with words like "Buy Now!" alt='Buy now' would be a good choice. If it's a graphical element: alt='' is great. – Armstrongest Commented Mar 22, 2010 at 16:37
Add a ment  | 

3 Answers 3

Reset to default 5

The alt attribute is meant to show up if the img is NOT shown. You probably want to use the title attribute if you're specifying tooltips.

How fast it displays is browser ( or OS ) dependent. You can't control it with html or CSS.

A good alternative would be to program a javascript alternative with jQuery.

See this page for some ideas:

http://jqueryfordesigners./coda-popup-bubbles/

The speed at which an alt tag displays is a function of the browser software and possibly OS-based settings. You're only going to get a faster response with a custom script.

You can use Tooltips to show the Title Attribute faster and nicer :) Not Alt...

Here is a good Tutorial with more than 25 examples...

本文标签: javascriptMake alt tag display quickerStack Overflow