Chosen jQuery插件的每个选项的工具提示 [英] Tooltips for each option of Chosen jQuery plugin

查看:680
本文介绍了Chosen jQuery插件的每个选项的工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用选择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屋!

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