使标题属性在悬停时立即显示 [英] Make title attribute appear instantly on hover

查看:123
本文介绍了使标题属性在悬停时立即显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有可能使锚标记的标题属性立即出现在鼠标悬停而不仅仅是秒后。
在JavaScript / jQuery和CSS中的任何解决方案都是好的。

解决方案 title 属性是依赖于浏览器的,并且没有定义任何API来控制它,仍然在specs中指定。这包括延迟,显示持续时间,使用的字体,字体大小等。



还有其他可以使用的技术 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆