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 thetitle
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. Thetitle
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
3 Answers
Reset to default 5The 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
版权声明:本文标题:javascript - Make alt tag display quicker - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744074005a2586406.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论