자동 완성 필드를 설정하고 싶습니다. 그래서 HTML로jQuery UI 자동 완성 IE 11 - 유선 동작
$(document).ready(function() {
$("#mytext").autocomplete({
source: function(request, response) {
$.getJSON("/ajax/autocomplete.php?term=" + $.trim(request.term), function(data) {
response($.map(data, function(item) {
return {label: highlightResult(item.label, $.trim(request.term))};
}));
});
},
minLength: 0
}).each(function() {
$(this).data("ui-autocomplete")._renderItem = function(ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a>" + item.label + "</a>")
.appendTo(ul);
};
});
...
$("#mytext").focusin(function() {
$(this).autocomplete("search", $(this).val());
});
});
을 썼다 :
<div style="visibility: hidden;"/>
<input type="text" id="mytext" />
</div>
<button onclick="showDiv();">Click To Show</button>
이 코드는 구글 크롬에서 잘 작동합니다. 하지만 IE 11에서 이상하게 작동합니다.
입력 내용은 기본적으로 숨겨져 있지만 버튼을 클릭하면 나타납니다.
이상한 행동 :
1) 자동 완성 메뉴 새로 고침 에 창 (몸)의 왼쪽 상단에 나타납니다.
2) 텍스트 상자에 텍스트가있는 경우 메뉴가 표시되지 않습니다. 나는 data
매개 변수가 때로는 (텍스트가있을 때), 정의되지 않은 - wierd ...
이러한 문제는 어떻게합니까? 도움이되는 해결책을 찾지 못했습니다.
이 DIV 필드에 위치를 가지고 있습니까? –
CSS가있는 CSS 또는 스크립트가 없습니다.이 코드는 – nrofis
입니다. 죄송합니다. 질문을 잘못 읽었습니다. 이제 그 문제를 이해하고 대답합니다. –