简体   繁体   English

jQuery自动完成显示在错误的位置

[英]jQuery autocomplete is showed in the wrong place

Below is my code 下面是我的代码

HTML: HTML:

<input autofocus="autofocus" type=text  id="modelloInput" style="width: 97%; outline:none; border:none; margin-left: 7px; float: left;" />

JS: JS:

<script type="text/javascript">
            var availableTags = [
              "ActionScript",
              "AppleScript",
              "Asp",
              "BASIC",
              "C",
              "C++",
              "Clojure",
              "COBOL",
              "ColdFusion",
              "Erlang",
              "Fortran",
              "Groovy",
              "Haskell",
              "Java",
              "JavaScript",
              "Lisp",
              "Perl",
              "PHP",
              "Python",
              "Ruby",
              "Scala",
              "Scheme"
            ];

            $(document).ready(function () {
                $('#modelloInput').autocomplete({

                    source: availableTags

                });
            }); 
</script>

It is working but I see the "autocomplete list" really far from the input and with the dot before the names like a html list. 它正在工作,但是我看到“自动完成列表”确实离输入很远,并且在名称(如html列表)之前加了点。

What could be the issue? 可能是什么问题? I guess it as CSS issue. 我认为这是CSS问题。

我认为您只是没有实现UI CSS:

http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/redmond/jquery-ui.css

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM