Clone object is not droppable

后端 未结 2 1952
孤城傲影
孤城傲影 2021-01-15 01:54

I\'m trying to clone a droppable object using Jquery but the cloned object is not droppable.

$(document).ready(function(){
$(\"input[value=\'Add\']\").click(         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-15 01:56

    I found out a way to accomplish this, by using the .live, I'm using a plugin .livequery which functions quite similiar with .live

    When you bind a "live" event it will bind to all current and future elements on the page

    $("input[value='Add']").livequery("click", function(e){
    e.preventDefault();
    $("div.field:last").clone().insertAfter("div.field:last");
    $("div.field").droppable();
    

提交回复
热议问题