Zurb Foundation与jQuery UI自动完成冲突吗? [英] Zurb Foundation conflicts with jQuery UI autocomplete?
问题描述
在加载Zurb Foundation 3.1之后,我无法使jQuery-UI自动完成工作.
I can't get jQuery-UI Autocomplete to work after loading Zurb Foundation 3.1.
任何人都可以让他们一起工作,或者找到了另一个可以与Foundation一起使用的自动完成插件?
Anyone got them to work together or found another autocomplete plugin that works with Foundation??
Uncaught TypeError: Object [object Object] has no method 'autocomplete'
(anonymous function) order.js:7
l foundation.min.js:18
c.fireWith foundation.min.js:18
v.extend.ready foundation.min.js:18
A foundation.min.js:18
推荐答案
在该页面上效果很好,但是如果您使用Orbit或Reveal等其他组件,并且您在Foundationn之上构建了一个站点,则 foundation .min.js 是必需的.
It works great in that page, but if you use other components like Orbit or Reveal, and you have a site built on top of Foundationn then foundation.min.js is necessary.
foundation.min.js 包括Modernizr,jQuery库,轨道,显示,工具提示.因此,您可以使用 foundation.min.js 中包含的jQuery库(Foundation 3.2包括jQuery 1.8.2).我将这些导入保留在主体的末尾,然后添加了我需要的内容(jQuery ui用于自动完成功能和datepicker,然后是脚本),因此最终如下所示:
foundation.min.js includes Modernizr, jQuery library, orbit, reveal, tooltips. So you can use jQuery library included in foundation.min.js (foundation 3.2 includes jQuery 1.8.2). I left those imports at the end of the body and then added what I needed (jQuery ui for the autocomplete and datepicker and then the script), so it ended up like this:
<script src="javascripts/foundation.min.js"></script>
<script src="javascripts/app.js"></script>
<script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
<script type="text/javascript">
$(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>
脚本按下一个顺序
- foundation.min.js 它包含jquery 1.8
- foundation.min.js 它需要jquery库
- 自定义脚本,它需要jquery库和jui ui
- foundation.min.js it contains jquery 1.8
- foundation.min.js it needs jquery library
- custom script it needs jquery library and jquery ui
这篇关于Zurb Foundation与jQuery UI自动完成冲突吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!