0
materialize css 및 js를 사용하고 있으며 jQuery도 있습니다.구체화 자동 완료 안 함
입력란에 입력 할 때 (입력 type="text"
) 모든 항목이 올바르게 작동하지만 뭔가를 입력 한 다음 다른 항목을 클릭하면 (자동 완성이 닫히지 만) 그렇지 않은 경우입니다. 텍스트를 지울 때까지 이렇게있어.
내 코드 :
<input type="text" id="search" class="header-search-input" placeholder="Search" style="width: 320px !important;" autocomplete="off" />
와 JS 코드 :
$('#search').autocomplete({
data: {
"Apple": 'https://maxcdn.icons8.com/Android_L/PNG/512/Operating_Systems/mac_os-512.png',
"Microsoft": 'http://www.freeiconspng.com/uploads/microsoft-new-logo-simple-0.png',
"Google": 'https://maxcdn.icons8.com/Share/icon/Logos//google_logo1600.png'
},
limit: 20, // The max amount of results that can be shown at once. Default: Infinity.
onAutocomplete: function (val) {
// Callback function when value is autcompleted.
},
minLength: 1, // The minimum length of the input for the autocomplete to start. Default: 1.
});