开发者

How to make a jQuery autocomplete's results go away immediately

I have a jQuery autocomplete field on one of my pages. When I'm focused on the autocomplete field and I hit tab, it takes a little bit for the list of results to go away. Also, if I hit enter in the autocomplete field, the results stick around forever.

Is there an easy, preferably built-in way to make the result list go away immediately when the field loses focus or when I press enter? I could write my own solution by observing the blur and keypress events but it seems like something 开发者_StackOverflow社区that would probably already be out there.


$(".ac_results").css("display", "none");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜