为什么我得到一个jQuery'ui.element is undefined'错误? [英] Why am I getting a jQuery 'ui.element is undefined' error?

查看:273
本文介绍了为什么我得到一个jQuery'ui.element is undefined'错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下内容:

$('#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库升级到最新版本。

I just upgraded jQuery from 1.2.6 to 1.3.2, and I also upgraded the jQuery UI library to the latest version.

推荐答案

'在较新的jQuery UI版本中删除了元素,请参阅此错误报告相应的来源变更集

The 'element' got removed in newer jQuery UI versions, see this bug report and the corresponding source changeset.

根据这些,你应该使用 $(this)代替:

According to those, you should use $(this) instead:

fromRowId = $(this).attr('id');

这篇关于为什么我得到一个jQuery'ui.element is undefined'错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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