jquery draggable accept: classpath

Posted by heldopslippers on Stack Overflow See other posts from Stack Overflow or by heldopslippers
Published on 2010-04-06T19:19:38Z Indexed on 2010/04/06 19:23 UTC
Read the original article Hit count: 220

Filed under:
|

Hi guys.. I have problems with the following bit of javascript/jquery code:

this.droppable = function(){
    $('.imageWindow .body .item').draggable();
    $('.groupWindow .body .item').droppable({ accept: $(".imageWindow .body .item"), 
        over: function(event, ui) {
            alert("this is valid!");
        }, 
        drop: function(){
            alert('dropped');
        }
    });
}

As you maybe know it is not possible to pass the following in the accept option:

$(".imageWindow .body .item")

But what is possible ? I want to pass a "class path" as an accept option ! It is probably a simple answer but i can't figure it out.

Of course i could do:

accept: ".item"

But because "groupWindow .body .item" is a sortable it would also accept himself!

Thanxs if you can help me!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript