jQuery qTip 2仅在焦点上打开所需的qTip
我在一个表单中获得了许多QTIP,如下所示:jQuery qTip 2仅在焦点上打开所需的qTip,jquery,jquery-plugins,qtip2,Jquery,Jquery Plugins,Qtip2,我在一个表单中获得了许多QTIP,如下所示: $('.selector').qtip({ content: { text: function(api) { // Retrieve content from custom attribute of the $('.selector') elements. return $(this).attr('qtip-content'); } } }); 我不想单独添加所有QTIP,因为
$('.selector').qtip({
content: {
text: function(api) {
// Retrieve content from custom attribute of the $('.selector') elements.
return $(this).attr('qtip-content');
}
}
});
我不想单独添加所有QTIP,因为它会创建许多我不喜欢的javascript事件
我的html是这样的,我想这会让回答我的问题变得容易:
<tr>
<td>
Main Alliase/Current Alliase:
</td>
<td><input type="text" id="maina"/>
</td>
<td id="handle-1" qtip-content="ToolTip's content here" class="selector">?</td>
<td><div id="error-1" class="errors"></div></td>
</tr>
当然,这会触发与之相关的所有工具提示
如何实现我的目标?这可能有助于:
$("#maina").bind("focus", function () {
$(this).closest("tr").find(".selector").qtip('toggle', true);
});
我到家后会试试的
$("#maina").bind("focus", function () {
$(this).closest("tr").find(".selector").qtip('toggle', true);
});