I've created a simple planner where the user can Drag and drop their items into allocated time slots. They can also resize these items.
When an item is resized, dragged over or dropped onto a droppable I need to check for collisions.
90% of the time everything works fine. However the other 10% of the time the droppable events 'over' and 'drop' don't fire.
There is nothing special about dragging its all default jQuery stuff as is the resizing. Note that the resizing is locked so it will increment by a certain number of pixels each resize. I mention this because every even resize of the div the function 'over' and 'drop' stops working on droppable divs.
Example: If the item starts at 20 pixels, every even resize won't fire these events - 40, 80, 120 etc
Also note that at certain zoom levels this will also work fine.
Below I've added a very cut down version of how I've setup the droppable, bear in mind this works more time than it doesn't. Theres a lot of code behind what I'm doing which makes it difficult to show it.
Is there a way to reset the grid positions for example:
I have two draggable elements outside of the area I want to drop them into, however when dragged these elements are not on the same grid. Is there a method of doing this.
I am using the draggable and droppable features in jQuery UI. Is there a way of changing the containment option in draggable when the element being dragged enters the element which will become its containment ie the droppable.
Using the droppable 'over' method I can change the containment fine however this only updates after the element has stopped dragging.
Is there a way of updating it sooner?
Project is local so can't show any demos - but as I said I am bascially checking if the element is over a droppable area, if it is it will set the containment locking it into the area. however this doesn't update until after the element is released.