Chosen jQuery插件的每个选项的工具提示 [英] Tooltips for each option of Chosen jQuery plugin
问题描述
我使用选择jQuery插件。
如何显示鼠标指针在某些选项上的工具提示?
更新:
请注意,我的主要问题是关于OPTION的工具提示。不是整个组合框。
我可以想出的最简单的解决方案是选择尊重标题
属性原始< option>
标签,因为似乎没有一个很好的方式来改变DOM的格式。 / p>
编辑 chosen.jquery.js
(版本1.0.0):
围绕第55行:将标题
添加到 this.parsed
数组中:
html:option.innerHTML,
title:option.title,
selected:option.selected,
围绕第253行:更新返回的< li>
以包含标题:
返回< li title = \+ option.title +\class = \\+(classes.join(''))+\+ style +data-option-array-index = \+ option.array_index +\> + option.search_text +< / li>;
I use Chosen jQuery plugin.
How can I show a tooltip when the mouse pointer is on some option?
UPDATED: Please notice, that my main question is about a tooltip for an OPTION. Not for whole "combobox".
Easiest solution I could come up with was to make chosen respect the title
attribute on original <option>
tags because there doesn't seem to be a good way to alter the format of the DOM.
Edit chosen.jquery.js
(version 1.0.0):
Around line 55: add the title
to the this.parsed
array:
html: option.innerHTML,
title: option.title,
selected: option.selected,
Around line 253: update the returned <li>
to include a title:
return "<li title=\"" + option.title + "\" class=\"" + (classes.join(' ')) + "\"" + style + " data-option-array-index=\"" + option.array_index + "\">" + option.search_text + "</li>";
这篇关于Chosen jQuery插件的每个选项的工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!