Html 如何增加 <a> 标题属性的默认悬停持续时间(工具提示)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1530028/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 01:00:10  来源:igfitidea点击:

How to increase default hover duration of <a> title attribute (tooltip)

htmltooltiphover

提问by justinl

Is there a way to increase the duration of a tool tip displayed using the title attribute of an html tag?

有没有办法增加使用 html 标签的 title 属性显示的工具提示的持续时间?

Currently in IE it appears to only have about a 5 second duration and then disappears.

目前在 IE 中它似乎只有大约 5 秒的持续时间然后消失。

回答by rahul

I think this is operating system dependent and you should not try to override that.

我认为这取决于操作系统,您不应该尝试覆盖它。

The best way will be to create a custom tooltip.

最好的方法是创建自定义工具提示。

Here are some good ones

这里有一些不错的

jQuery Tooltip Plugin Demo

jQuery 工具提示插件演示

回答by Make it easy is the hard part

How to increase default hover duration of title attribute (tooltip)

如何增加标题属性的默认悬停持续时间(工具提示)

Dont use IE, no time limit in Firefox browser. Or use the code I done.

不要用IE,火狐浏览器没有时间限制。或者使用我做的代码。

I made some code in html/css only in one file, could not make it easier.

我只在一个文件中用 html/css 编写了一些代码,再简单不过了。

<!DOCTYPE html><html><body><style>
.m span{display: none;list-style: none} .m {z-index:24;position:relative;display:inline-block}
.m:hover span{z-index:999;display:block;position:absolute;top:19px;left:1em;border:1px solid #000;background-color:#eee;color:#000;min-width:300px}
</style>
<div class="m"> News         <span> Links inside span works good <a target="_blank" href="http://cnn.com">Cnn.com</a></span></div>
<div class="m"> Hover over here and Information comes up <span> To make complex things easy is not so easy to do. </span></div> 
<br> Just som text here to give you the 3D effect <br>
</body></html>

回答by Palantir

To elaborate further on phoenix' answer. Custom tooltips will allow you great flexibility in their appearance and layout. You need to get a JavaScript library (for example, jquery, or mootools) and get a plugin to show them. Then you will link the JQuery .js file, the plugin's one, and the css, finally you will add some markup to make it work.

进一步详细说明凤凰的回答。自定义工具提示将使您在外观和布局方面具有极大的灵活性。您需要获得一个 JavaScript 库(例如 jquery 或 mootools)并获得一个插件来显示它们。然后您将链接 JQuery .js 文件、插件的文件和 css,最后您将添加一些标记以使其工作。

For example, this one: http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/or this one: http://craigsworks.com/projects/simpletip/

例如,这个:http: //bassistance.de/jquery-plugins/jquery-plugin-tooltip/或这个:http: //craigsworks.com/projects/simpletip/

They are usually quite simple to install, the only requirement is that your site supports javascript.

它们通常安装起来非常简单,唯一的要求是您的站点支持 javascript。

回答by Himadri

Try WZ tooltip (may no longer be maintained): Click here

尝试 WZ 工具提示(可能不再维护):单击此处