jQuery 可排序 UI 语法问题
我不太确定要搜索什么来解决这个问题。
我收到以下代码的语法错误,因为我有 2 个(不知道如何称呼它们) 在 .sortable 选项中。您能告诉我这段代码做错了什么吗?
我使用占位符以及此页面中的 connectWith http://jqueryui.com/demos/sortable/# portlet 并且似乎没有任何示例展示如何同时编写它们。
当我注释掉
placeholder: "placeholder-highlighting"
或
connectWith: ".sortable-content"
我的代码如下时,语法错误不存在:
$(function() {
$( ".sortable-content" ).sortable({
placeholder: "placeholder-highlighting"
connectWith: ".sortable-content"
});
$( ".sortable" ).disableSelection();
});
告诉我它们叫什么的加分!
Im not quite sure what to search for to sort out this problem.
I am getting syntax error with the following code because i have 2 (no idea what to call them)
in the .sortable options. Would you be able to tell me what i have done wrong with this code?
Im using a placeholder and also a connectWith from this page http://jqueryui.com/demos/sortable/#portlets and there doesnt seem to be any examples showing how to write both of them at the same time.
The syntax error is not there when i comment out
placeholder: "placeholder-highlighting"
or
connectWith: ".sortable-content"
My code is below:
$(function() {
$( ".sortable-content" ).sortable({
placeholder: "placeholder-highlighting"
connectWith: ".sortable-content"
});
$( ".sortable" ).disableSelection();
});
Bonus points for telling me what they are called!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它们被称为期权。您正在调用“可排序”方法,然后说“使用这些选项而不是默认选项(如果有的话)”。
您需要在每个选项之间添加逗号!
They are called options. You are calling the "sortable" method and then saying "use these options instead of the default options (if there are any)".
You need to put a comma between each option!