[問題] JQuery draggable與droppable的問題

看板Ajax作者 (target)時間11年前 (2014/07/02 23:44), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
各位前輩好~ 小弟最近在嘗試使用JQuery來美化網頁的前端 但最近碰到一個問題卡蠻久了,想請問大家看看: 目標是能將div複製本身拖曳進gridview的itemTemplate內的div 而複製進去之後還能在gridview內的itemTemplate間拖曳(這時就不需複製本身) 以下是程式碼 $(".Timeitem").draggable({ //一開始欲拖曳的div helper: "clone", revert: "invalid", cursor: "move", opacity: 0.50, drop: function (event, ui) { dragItem.hide(dragItem); } }); $(".SetMonthSchedule").droppable({ drop: function (event, ui) { var dropItem = $(this); var dragItem = ui.draggable; dragItem.clone().appendTo(dropItem); } }); $(".SetMonthSchedule").draggable({ helper: "clone", revert: "invalid", opacity: 0.50, drop: function (event, ui) { ui.draggable.hide(dragItem); } }); 目前這個程式可以執行, 但一開始的div拖曳進去後 想要在各個itemTemplate間內的div中移動卻依然會複製自己 本來想說取消掉.SetMonthSchedule內的clone就好, 但移動後div會跑掉= = 想了兩天了依然解不出來, 希望高手幫忙, 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.123.174.212 ※ 文章網址: http://www.ptt.cc/bbs/Ajax/M.1404315891.A.7E0.html
文章代碼(AID): #1Jj2ZpVW (Ajax)
文章代碼(AID): #1Jj2ZpVW (Ajax)