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 :)