1

尝试在自动完成 jquery 插件的焦点事件上绑定一些其他操作(在包装元素上显示工具提示)jquery 代码:

$(document).ready(function(){

$( "#municipality_cb" ).combobox({
                focus: function(event, ui) {
    //tipTip(); - tooltip script* 
                $("#municipality_wrap").tipTip({maxWidth: "auto", edgeOffset: 10}); 
                }

                });
});

html:

<div class="ui-widget">
//-combobox wrapper div for tooltip
<div id="municipality_wrap" title="Chose municipality: Karposh" style="float: left;">
<select id="municipality_cb" tabindex="2" data-placeholder="Choose ..." title="test">

        <option value=""></option>
            other options....  

    </select></div></div>

工具提示根本不显示。我做错了什么?请帮忙 :)

Jquery 自动完成插件(查看事件选项卡) http://jqueryui.com/demos/autocomplete/#combobox

4

2 回答 2

0

I was running into the same problem...

The trick here is that the combobox replaces your select with an input, so instead of tying the focus to the select, I got this to work by tying it to the wrap:

$("#municipality_wrap input").focus(function() { ... });
于 2012-05-21T23:05:04.247 回答
0
$(document).ready(function(){
$("#municipality_cb" ).focus(function() {
 //tipTip(); - tooltip script* 
        $("#municipality_wrap").tipTip({maxWidth: "auto", edgeOffset: 10}); 
        });
       });
于 2012-05-19T11:46:20.877 回答