jQuery Sortable回调不起作用? [英] jQuery Sortable callbacks not working?

查看:256
本文介绍了jQuery Sortable回调不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用可排序组件ui.jquery.com/"rel =" nofollow noreferrer> jQuery UI .即使使用此简约测试,回调也似乎根本不起作用:

I'm using the Sortable component of jQuery UI. The callbacks don't seem to work at all, even with this minimalistic test:

<script type="text/javascript" src="jquery-1.3.js"></script>
<script type="text/javascript" src="jquery-ui-personalized-1.6rc4.js"></script>
<script type="text/javascript">
$(document).ready(function () {
    $("#outer").sortable({
        start: function (e, ui) {
            alert("started");
        },
        update: function (e, ui) {
            alert("updated");
        }
    });
});
</script>
<ul id="outer">
<li>apple</li>
<li>orange</li>
</ul>

对这些元素重新排序时,没有任何警报.

I get none of the alerts when I reorder these elements.

我的用法是否正确?或者我可能误读了文档?

Is my usage correct or am I perhaps misreading the documentation?

启动功能(事件,用户界面)

start Function(Event, ui)

排序开始时调用的函数.

Function that gets called when sorting starts.

推荐答案

根据最新的主干版本进行修复.

It seems that the .sortable() is having some technical difficulties according to this post. You may need to use SVN to download the latest trunk release to fix it.

这篇关于jQuery Sortable回调不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆