views:

9

answers:

2

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!

A: 

You should be able to do:

accept: ".imageWindow .body .item"
PetersenDidIt
A: 

You can do this :)

accept: ".imageWindow .body .item"

The accept option takes any valid selector, so treat it the same as you would $(selectorHere).

Nick Craver
Ohw damn it .. yes! (i made a typo in my div classes) .. I searched for hours, thinking it was my js ... grrr thanxs though ! really appreciated (you to petersendidit)
@heldopslippers - Be sure to accept an answer if it answered your question via the checkmark on the left of it...it makes your future questions much more appealing to answerers :)
Nick Craver
thanxs for the tip.. and done !