Hello,

I am creating a website that must have hundred's of drag- and
droppables so, I want to enable a Draggable on the mouseDown event
(partially working) and a Dropable on the mouseUp event or something.
So that they dont have to be created at once.

<b>Question 1): </b>
As my title suggest, I want a draggable on the OnMouseDown event. This
is already working:
<i>function createDrag(id){
        $("#"+id).draggable();
  }
<div id="draggable" onMouseDown="createDrag('draggable');">Drag me</
div></i>

But when I click the dragable, it is not following the cursor. When I
re-click the dragable, it is following. The question (1) is how to let
the dragable directly following the cursor at one event, cq the
OnMouseDown event?


<b>Question 2): </b>
How to let the droppable being created on the OnMouseUp event?
I have trying code like this:
<i>
$("#droppable").droppable({
      drop: function(ev, ui) { console.dir(ui) } // nm. I use this to
get the items in firebug

    });
<div id="droppable" onMouseUp="createDrop('droppable');">Drop here</
div></i>

So I hope you understand it, and I hope that someone is willing to
read and answer what I am doing wrong and suggest something in the
right direction! :-)

Thanks in advance

Reply via email to