israel
israel

Reputation: 41

how to limit droppable to contain only full draggable

So how to limit droppable to contain only full draggable?

Look at this example.. http://jsfiddle.net/jWNkh/1/.. Try to drag the draggable to the droppable and you'll see that the droppable accept even if the draggable is only half in.

How to make it not accept if the draggable is only half in? how to make it accept only if the draggable is fully in the droppable?

you can see in jsfiddle but my JS code is

$('#drag').draggable({ revert: "invalid"});
$('#drop').droppable();​

Upvotes: 1

Views: 609

Answers (1)

Gurpreet Singh
Gurpreet Singh

Reputation: 21233

Use tolerance: "fit"

$('#drop').droppable({ tolerance: "fit" });​

Working DEMO

You can find documentation here

Upvotes: 7

Related Questions