我想为选中的项目附加一个点击事件,并在jquery的自动完成控件中显示鼠标上的工具提示
i want to attach a click evet for the selected items and show tooltip on mouse over in autocomplete control in jquery
$(document).ready(function(){
$("#select3").fcbkcomplete({
json_url: "data.txt",
addontab: true,
maxitems: 10,
input_min_size: 0,
height: 10,
cache: true,
newel: true,
select_all_text: "select",
});
});
我在后面的代码中生成上面的代码。我想为选中的项目附加一个点击事件,并在jquery的自动完成控件中显示鼠标提示
Thanks in advance
据我所知,自动完成插件在"div"控件中呈现提示项。你可以试试
$("#select3 div").click(function() { });
$("#select3 div").title("...");
希望这能有所帮助!!
根据http://docs.jquery.com/UI/Autocomplete,这应该可以工作:
$("#select3").fcbkcomplete({
json_url: "data.txt",
addontab: true,
maxitems: 10,
input_min_size: 0,
height: 10,
cache: true,
newel: true,
select_all_text: "select",
focus: function (event, ui) {
//your mouse over event, also includes keyboard arrow key
//ui.item has the focused item data: ui.item.label or ui.item.value
your show tooltip function here.
},
select: function (event, ui) {
//your click event, also includes enter key and tab key to select
//event.target is your item
your click action here.
}
});
相关文章:
- 使用jQuery动态添加表并在其中动态添加行
- 遍历类元素数组,并在jquery中选择同级元素
- 如何使用Jquery水平打印表中的数组元素,并在某个元素之后垂直打印
- 如何使用jQuery来添加分段的表单字段,并在添加不同值时进行更新
- 如何通过jQuery选中所有复选框并在单击一个复选框时取消选择
- 使用jQuery延迟表单输入,并在延迟后在同一页面上显示结果
- JQuery-重新加载Div并在点击时调用API
- 如何使用jQuery更改当前URL并在单击时打开新选项卡
- 使用简单的JavaScript或jQuery单独识别每个选择选项,并在DIV中显示
- 当行增加时自动递增序列号,并在 jQuery 中删除行时自动重新调整编号顺序
- 多次克隆对象并在jQuery中附加克隆
- 创建一个变量并在页面之间移动时“存储它”,jQuery
- 在 Jquery 中,我可以存储对象引用并在以后使用它吗?
- 在不使用jQuery的情况下解析json,并在HTML代码中添加值
- 从日期选择器中获取默认格式的日期,并在jquery UI中转换为其他格式
- 获取post-jquery并在$_post中回显它(这可能吗?)
- 使用 Javascript/JQuery 并在页面加载时获取未定义的 var
- 将数据从JSP传递到jQuery并在Highcharts中绘制
- JQuery并在多个表单中获取1个隐藏值
- 动态加载jQuery并在另一个函数中使用它