0

Let's say I have two main elements on a page: a box, and a list of items.

I have clicked the box and have started to drag the mouse. When the cursor leaves the box, I want to change the element receiving the mouse movement to one of the items in the list, and then trigger jquery sortable on the list without having to release the mouse and click on it.

I've tried something along the lines of...

$(document).on('mouseleave', '#box', function () {
        $(document).mouseup();
        $('#listitem').mousedown();
});

$(document).on('mousedown', '#listitem', function () {
    $(".list").sortable({
        create: function () {
            alert('created');
        },
        start: function (event, ui) {
            alert('started');
        },
        stop: function (event, ui) {
        }
    });
});

So it's being created, but it's not starting. Any help would be greatly appreciated :)

1 Answers1

0

Could you not place the box inside a container div, then use MouseOut on the container? That way once you drag the box out of the container you mouse will no longer be inside the container and will trigger the MouseOut effect to make any changes you wish?

Shakesy
  • 335
  • 2
  • 8
  • The mouseout and mouseup on the box, and the mousedown on the list item are all working, but the list item will not become draggable until I release and then click on the item. – Hungry Little Caterpillar Apr 28 '14 at 11:31