我有以下内容:
$('#widgets ul').sortable(
{
connectWith: ['#widgets ul'],
opacity: 0.7,
start: function(e, ui) {
fromWidgetPosition = ui.item.prevAll().length + 1;
fromRowId = ui.element.attr('id');
我刚刚将 jQuery 从 1.2.6 升级到 1.3.2,并且还将 jQuery UI 库升级到了最新版本。
最佳答案
“元素”在较新的 jQuery UI 版本中已被删除,请参阅此 bug report和 corresponding source changeset .
根据这些,您应该使用 $(this)
代替:
fromRowId = $(this).attr('id');
关于jquery - 为什么我收到 jQuery 'ui.element is undefined' 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1505507/