jquery拖放问题 [英] jquery drag and drop problem

查看:65
本文介绍了jquery拖放问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份清单。它具有拖放功能。如何使用jquery获取拖动项目名称。请帮助



i have a list. it has drag and drop feature. how to get drag item name using jquery. please help

$( ".cart ol" ).droppable({
     accept: ":not(.ui-sortable-helper)",
     drop: function(event, ui ) {
     $( this ).find( ".placeholder" ).remove();
     $( "<li></li>" ).html(ui.draggable.html()).appendTo(this);
     }

推荐答案

(。cart ol)。droppable({
accept::not(.ui-sortable-helper),
drop:function(event,ui){
( ".cart ol" ).droppable({ accept: ":not(.ui-sortable-helper)", drop: function(event, ui ) {


(this).find(。placeholder)。remove();
( this ).find( ".placeholder" ).remove();


(< li>< / li> ).html(ui.draggable.html())。appendTo(this);
}
( "<li></li>" ).html(ui.draggable.html()).appendTo(this); }


这篇关于jquery拖放问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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