我想为选中的项目附加一个点击事件,并在jquery的自动完成控件中显示鼠标上的工具提示

i want to attach a click evet for the selected items and show tooltip on mouse over in autocomplete control in jquery

本文关键字:jquery 并在 控件 工具提示 鼠标 显示 事件 项目 一个      更新时间:2023-09-26
  $(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.
        }
   });