答案 0 :(得分:0)
您可以控制分档与#tags
和<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
</head>
<body>
<div class="dropdown bigdiv">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Example
<span class="caret"></span></button>
<ul class="dropdown-menu bigul">
<li><a href="#">dumped_li</a></li>
<li class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
</li>
</ul>
</div>
<br/>
<br/>
<br/>
<br/>
<br/>
<div class="anotherdiv" style="background-color: #447e9b; height: 200px;">
GoesHere:
<br/>
<ul></ul>
</div>
</body>
<script>
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
];
$('#tags').autocomplete({
search: function(event, ui) {
$('.anotherdiv ul').empty();
},
source: availableTags
}).data('autocomplete')._renderItem = function(ul, item) {
return $('<li></li>')
.data('item.autocomplete', item)
.append(item.value)
.appendTo($('.anotherdiv ul'));
};
</script>
参数对齐的方式。在这种情况下,您可能需要center
boundary