Either using plain HTML or jQuery assisted JavaScript, how do you display tooltips on individual <option> elements to aid the decision process (there is not enough room for a different kind of control and some help will be needed).

Can this be done though a plug-in or similar?

I have tried a few tooltip plugins for jQuery with no success (including the one called Tooltip).

This solution should:

  • work in IE, WebKit as well as Gecko;
  • utilizing standard <select> wrapped <option> elements.

因此,如果解决方案想要使用其他标记,它应该动态地将这些元素转换为它需要的元素(并且不期望初始标记有任何不同).


这方面的代码可以在here中找到,它在SafeSurf部分下,我想在这里显示一些关于选项滚动的帮助,以了解选项的含义.目前,它只能在"事后"显示,一些对用户的前期帮助将是有益的.

Appreciate that this is not easy and that something will probably need to be created - so the bounty will be awarded to the most complete solution or the specific hook that lands me closest to a solution I can create.

推荐答案

似乎在这个问题提出后的两年里,其他浏览器已经迎头赶上了(至少在Windows上是这样).对其他人不确定).您可以在选项标签上设置"title"属性:

<option value="" title="Tooltip">Some option</option>

这在Chrome 20、IE 9(及其8和7模式)、Firefox 3.6、RockMelt 16(基于Chrome的)中都有效,所有这些都在Windows 7上

Jquery相关问答推荐

jQuery中的多个 Select 器链接?

jquery克隆div并将其附加在特定div之后

在页面上放置文件时如何设置文件输入值?

jQuery 与 ExtJS

JSLint 消息:未使用的变量

延迟后运行功能

使html文本输入字段随着我输入而增长?

如何获取 onclick 调用对象?

如何将参数传递给 JavaScript 中的匿名函数?

jQuery Force 为 iframe 设置 src 属性

将打开/关闭图标添加到 Twitter Bootstrap 可折叠项(手风琴)

使用 AJAX 加载 Bootstrap 弹出内容.这可能吗?

jQuery 和 jQuery Mobile 的区别?

使用 jQuery 获取选中复选框的值

JavaScript 等效于 jQuery 的扩展方法

如果一个元素正在被动画,我如何用 jQuery 找出?

如何使用 jquery 使下拉列表只读?

Ajax 处理中的无效 JSON 原语

catch forEach 最后一次迭代

如何使用 jQuery 处理复选框的更改?