检测拖动克隆的div。

时间:2013-05-26 16:19:02

标签: jquery

嗨,我有这个代码,我试图检测每个克隆去哪个div。

$(function() {      
        $('#draggableImages img').draggable( {
            helper: "clone",
            containment: '#dropbox',
            cursor: 'move',
            revert: 'invalid'
        })

    $("#Sunday").droppable({
    drop: function(event, ui) {
        if (ui.draggable[0].id) {
            $(this).append($(ui.helper).clone().draggable());
        }
    }

});

.
.
.

    $("#Saturday").droppable({
    drop: function(event, ui) {
        if (ui.draggable[0].id) {
            $(this).append($(ui.helper).clone().draggable());
        }
    }

});

我的div检查在这里不起作用我的尝试方式。这是我认为在单击按钮时应检测克隆的部分

$( '#Checkdiv input[type=button]' ).click(function(){
    if($("#Monday:has(camera)").length > 0){
        alert("Camera");
    }
    else if($("#Monday:has(star)").length > 0){
        alert("star");
    }   
    else{
        alert("no");
    }
});


    });

0 个答案:

没有答案
相关问题