jQuery UI Autocomplete - menu disappears on hover

后端 未结 6 2154
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-02 16:18

I\'m trying to use jQuery UI Autocomplete to bring up a list of names of people in a MySQL Database. The basic function is working - when you type in two or more letters a l

6条回答
  •  佛祖请我去吃肉
    2020-12-02 17:10

    I had same problem and I did not use the jquery UI twice, my jquery UI was part of jquery DataTable.
    My problem was solved with following code
    Note: with this code we need to write code to close the UL when we do not click on UL

    $(".gettingContactList").autocomplete({
         source:this.contactList,
         /*following focus function was written because when mouse
         was being hovered over the menu, the menu was disappearing*/
        focus:function(e,ui) { 
          $(e.toElement).parents().show()
        }
    })

提交回复
热议问题