4
我在我的項目中使用了select2。根據設計,我刪除了selectbox2中的搜索框,但在刪除搜索框後,鍵盤選擇選項不起作用。任何人都可以幫我解決這個問題。 - 感謝在select2鍵盤中刪除搜索框後,選擇選項不起作用
代碼:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Select2 Template</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/css/select2.min.css">
</head>
<style>
body {
margin: 0;
padding: 0;
}
</style>
<body>
<div>Skills</div>
<select id="skills" style="width: 200px">
<option>html</option>
<option>css</option>
<option>js</option>
</select>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/js/select2.min.js"></script>
<script>
$(document).ready(function() {
$('#skills').select2({
minimumResultsForSearch: Infinity
});
});
</script>
</body>
</html>
JS斌:http://jsbin.com/kipuzet/edit?html,output
無效。 '$ .fn.select2'該插件將自己的名字命名爲'select2',然後'select'將如何工作。 –
你試過嗎? –
是的,我試過了。在一些好奇心。 –