Can I click on a draggable initial drag and drop using jquery?

I have this markup

<div id="colorpicker-background"> <div id="colorpicker-selector"></div> </div> 

With JS like this:

 $('#colorpicker-selector').draggable({ containment : $('#colorpicker-background'), handle : $('#colorpicker-selector') }) 

When the onmousedown user fires #colorpicker-background , I move the #colorpicker-selector to where mousedown is located. The problem is that the user cannot continue to drag and drop, even if the selector is now under the cursor.

I tried running drag, dragstart, mousedown, mousedown.draggable on #colorpicker-selector based on all kinds of posts I read and I had no luck.

Another user had the same problem, but from 6 months ago, without an answer, and with different versions of jQuery (since there have been many updates since then): jquery start dragging an object when clicking on another

+2
jquery jquery-ui jquery-ui-draggable
source share
1 answer

On mousedown I bind the updateSelector function

 updateSelector = function( e ) { // update position yada yada... $('#colorpicker-selector').trigger( e ); // make the dragging happen } 
+3
source share

All Articles