제이쿼리 질문좀드립니다 형님들..
본문
<!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>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" 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="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body>
<form id="jQueryAutocomplete">
<fieldset>
<legend>jQuery create Drop down using autocomplete</legend>
<p>
<label for="myDropDown">Just click to see:</label><br />
<input id="myDropDown" type="text" name="myDropDown" />
</p>
</fieldset>
</form>
</body>
</html>
$(document).ready(function() {
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('');
}
});
});
이거 지금 잘되는것인데.. 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
무슨 소슨지는 잘모르겠네요
기본적으로 jquery의 충돌이 있어서 소스가 작동되지 않는 경우도 있습니다
하지만 php라고 해서 이상한건 없습니다
참고사이트 http://htmldrive.net
답변을 작성하시기 전에 로그인 해주세요.