gurbinder gurbinder - 2 months ago 17
jQuery Question

issue in droppable area jquery ui

this is my droppable div

<div style="position: relative;" class="f_img ui-draggable ui-droppable" id="f_img1" data-type="swap" data-is-empty="yes">
<img src="http://localhost/Gaelsoft//assets/images/tshirt.png" style="cursor:pointer;">
</div>


and this looks like this enter image description here

div has red border and image is inserted using img tag.

<div class="f_img"></div>


is droppable.

now what happens
drop is working fine when i drag my object to left of the image, but do not work when i drag over img and right to the img.

can any one help me??

Answer

add tollerance : "pointer"

now Mouse pointer overlaps the droppable. and you will be able to drop your object any where in draggable area.

$( ".selector" ).droppable({
  tolerance: "fit"
});
Comments