제이쿼리 질문좀드립니다 형님들.. 채택완료
우악친구당
9년 전
조회 6,098
</p><p><!DOCTYPE html>
<html lang="ko">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>jQuery Drop Down using AutoComplete and minLength of 0</title></p><p> <link href="<a href="<a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" target="_blank" rel="noopener noreferrer">http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css</a>"><a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" target="_blank" rel="noopener noreferrer">http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css</a></a>" rel="stylesheet" type="text/css" />
<STYLE TYPE="text/css" media="all">
.ui-autocomplete {
position: absolute;
cursor: default;
height: 150px;
overflow-y: scroll;
overflow-x: hidden;
}
</STYLE>
<script src="<a href="<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js" target="_blank" rel="noopener noreferrer">http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js</a>"><a href="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js" target="_blank" rel="noopener noreferrer">http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js</a></a>" type="text/javascript"></script>
<script src="<a href="<a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" target="_blank" rel="noopener noreferrer">http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js</a>"><a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" target="_blank" rel="noopener noreferrer">http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js</a></a>" type="text/javascript"></script>
<script type="text/javascript" src="app.js"></script></p><p></head>
<body></p><p> <form id="jQueryAutocomplete">
<fieldset>
<legend>jQuery create Drop down using autocomplete</legend></p><p> <p>
<label for="myDropDown">Just click to see:</label>
<input id="myDropDown" type="text" name="myDropDown" />
</p>
</fieldset>
</form></p><p></body>
</html></p><p>
</p><p>$(document).ready(function() {</p><p> var source = ['jQuery', 'Dojo', 'ExtJs', 'Prototype', 'Java', 'Android', 'MySQL', 'PHP'];
$("input#myDropDown").autocomplete({
minLength: 0,
source: source,
autoFocus: true,
scroll: true,
}).focus(function() {
$(this).autocomplete("search", "");
}).live("blur", function(event) {
var autocomplete = $(this).data("autocomplete");
var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex($(this).val()) + "$", "i");
autocomplete.widget().children(".ui-menu-item").each(function() {
//Check if each autocomplete item is a case-insensitive match on the input
var item = $(this).data("item.autocomplete");
if (matcher.test(item.label || item.value || item)) {
//There was a match, lets stop checking
autocomplete.selectedItem = item;
return;
}
});
//if there was a match trigger the select event on that match
if (autocomplete.selectedItem) {
autocomplete._trigger("select", event, {
item: autocomplete.selectedItem
});
//there was no match, clear the input
} else {
$(this).val('');
}
});
}); </p><p>
이거 지금 잘되는것인데.. php에 붙이면 안되네요 ㅜㅜ
<script src="./jquery.js"></script>
<script src="./jquery.datetimepicker.js"></script>
<script>/*
window.onerror = function(errorMsg) {
$('#console').html($('#console').html()+'<br>'+errorMsg)
}*/
$('#datetimepicker1').datetimepicker({
datepicker:false,
format:'H:i',
step:10
});
$('#datetimepicker111').datetimepicker({
datepicker:false,
format:'H:i',
step:10
});
</script>
이거 지금 php파일에 들어있는건데 이거와 간섭이 생기는것은 아니겟죠...?ㅜㅜ
제이쿼리 혹시 input 박스 눌렷을시 밑에 리스트나오게좀 하고싶거든여..ㅜㅜ
예제 잇는사이트라도 좀 ㅜㅜ
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
채택된 답변
+20 포인트
9년 전
무슨 소슨지는 잘모르겠네요
기본적으로 jquery의 충돌이 있어서 소스가 작동되지 않는 경우도 있습니다
하지만 php라고 해서 이상한건 없습니다
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인