使标题属性在悬停时立即显示 [英] Make title attribute appear instantly on hover
问题描述
有可能使锚标记的标题属性立即出现在鼠标悬停而不仅仅是秒后。
在JavaScript / jQuery和CSS中的任何解决方案都是好的。
还有其他可以使用的技术 em> title
属性。其中一些在其他答案中提到。请注意,简单的CSS工具提示可以在纯CSS中实现,而不是简单灵活。当使用这些技术时,要显示的数据通常不是在 title
属性中,因为它的处理是依赖于浏览器的,因此会有您的特殊工具提示显示和浏览器实现 title
的风险。虽然可以防止后者,但是当启用脚本时,使用对任何东西没有默认效果的属性更简单,例如 data-title = ...
或 data-tooltip = ...
。
is there a possibility to make a title attribute of an anchor tag appear instantly on mouseover not just after seconds. Any solution in JavaScript/jQuery and CSS is good.
The handling of the title
attribute is browser-dependent, and no APIs have been defined to control it, still less specified in specs. This includes the delay, the duration of the display, the font used, font size, etc.
There are other techniques that can be used instead of the title
attribute. Some of them have been mentioned in other answers. Note that simple "CSS tooltips" can be implemented in pure CSS rather simply and flexibly. When using these techniques, the data to be shown is usually not in a title
attribute, since its handling is browser-dependent, so there would be a risk of having your special tooltip display and a browser’s implementation of title
. Though it is possible to prevent the latter, when scripting is enabled, it is simpler to use an attribute that has no default effect on anything, such as data-title=...
or data-tooltip=...
.
这篇关于使标题属性在悬停时立即显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!