JQuery UI Drop Disable on selected elements

Posted by Suneth Kalhara on Stack Overflow See other posts from Stack Overflow or by Suneth Kalhara
Published on 2012-06-10T04:02:45Z Indexed on 2012/06/10 4:40 UTC
Read the original article Hit count: 383

Filed under:
|
|

i want to add drop limit on circles, i wrote a scrit for dragging circles

the problem is user can drop circle on another circle, i don't want to allow it, simply i need to revert if the user drag and drop circle on another circle.

i write some codes for this. but this not working for me, it always revert the dropped circle. here is my example url

http://webxtreams.net/demoprofiles004/circledragger.html

here is js code i run on fire bug

$(".circle").draggable({
    revert: 'invalid'
});

$(".circle").droppable({
    accept: function(el) {        
        return el.hasClass('.circle');
    }
});

please help me to do that.

have another little question - can we track the reverting event on this, i need to repaint the lines when reverting the circle :)

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui