data(“draggable”) is undefined in jQuery-ui-1.10.3

北战南征 提交于 2019-12-10 18:07:33

问题


I have problem after upgrading jquery and jquery ui with new version. I am getting data("draggable") undefined inside droppable.

Fiddle shows my problem.

$(this).data("draggable").originalPosition = {
      top: 0,
      left: 0
}

It works with jQuery 1.8.3 and jQuery UI 1.9.2. But not working when I use jQuery 2.0.2 and jQuery UI 1.10.3.

You can check using firebug at line number 39 which shows undefined when you are using latest jQuery files.

Please help me or give any alternatives. Thanks in advance.


回答1:


I think it got renamed, try

$(this).data('ui-draggable')


来源:https://stackoverflow.com/questions/18850289/datadraggable-is-undefined-in-jquery-ui-1-10-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!