admin管理员组文章数量:1295103
Following is my code:
var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++",
"Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell",
"Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
$("#City").autoplete({
source: availableTags
});
From Docs, the default behavior is a kind of dropdown
the matched items. But for me it is showing like
Screenshot:
10 results are available, use up and down arrow keys to navigate.
Sorry, I couldn't reproduce this behavior in jsfiddle. The navigation is done using up and down arrow keys. I don't want this, how can I revert back to default dropdown? Please share your suggestions.
Updates:
With @Anton reference, I was able to remove the validation message, however the dropdown
is not showing. But I am able to navigate using up/down arrow keys. Any feedback on this?
Following is my code:
var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++",
"Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell",
"Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
$("#City").autoplete({
source: availableTags
});
From Docs, the default behavior is a kind of dropdown
the matched items. But for me it is showing like
Screenshot:
10 results are available, use up and down arrow keys to navigate.
Sorry, I couldn't reproduce this behavior in jsfiddle. The navigation is done using up and down arrow keys. I don't want this, how can I revert back to default dropdown? Please share your suggestions.
Updates:
With @Anton reference, I was able to remove the validation message, however the dropdown
is not showing. But I am able to navigate using up/down arrow keys. Any feedback on this?
- 1 Found something here that might fix the problem stackoverflow./questions/13011127/… – Anton Commented Sep 11, 2013 at 7:15
- try to include it in a function like $(function() {} – Able Commented Sep 11, 2013 at 7:19
4 Answers
Reset to default 5Try this according to this answer on SO
$("#City").autoplete({
source: availableTags,
messages: {
noResults: '',
results: function() {}
}
});
You have to add jquery-ui.css
in your project folder and link it.
Edit the ui-autoplete
in the above .css and add z-index = 4000
into that. Your dropdown should work fine.
Anton is right.
Also please note I think it's not a best practice to use some id starting in capital :)
$("#city")
Use this example on fiddle.
I got same problem and solve it with that annoying tooltip by including default css style file for jquery.ui.
<link rel="stylesheet" href="jquery-ui/themes/base/jquery-ui.min.css" />
Just forgot to do this after including jquery-ui javascript source file jquery-ui.min.js
.
本文标签: javascriptjQuery UI autocomplete strange behaviorStack Overflow
版权声明:本文标题:javascript - jQuery UI autocomplete strange behavior - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741613128a2388374.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论