与使用 jquery 的 Foundation 框架的库存在冲突。为了将 jQuery UI 与 Foundation Zurb Framework 一起使用,您需要删除代码末尾的两个导入:
Foundation.min.js 和 javascripts/app.js
您可以在我的示例代码中看到它正在工作(您必须包含基础资源才能看到它工作(foundation.min.css、app.css 和modernizr.foundation.js)
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width" />
<title>jQuery UI Autocomplete - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<!-- Included CSS Files (Compressed) -->
<link rel="stylesheet" href="stylesheets/foundation.min.css">
<link rel="stylesheet" href="stylesheets/app.css">
<script src="javascripts/modernizr.foundation.js"></script>
<!-- IE Fix for HTML5 Tags -->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script>
$(function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</script>
</head>
<body>
<br>
<br>
<div class="row">
<div class="four columns">
<label for="tags">Programing Language: </label>
<input type="text" id="tags" placeholder="Language"/>
</div>
<div class="four columns">
<label for="city">Name: </label>
<input type="text" id="city" placeholder="State" />
</div>
<div class="four columns">
<label for="tags">Date: </label>
<input type="text" id="datepicker" placeholder="dd/mm/yyyy"/>
</div>
</div>
</body>
</html>