I'm trying to 'trigger' a drag and drop manually without the interaction of a mouse/user.
So far I have been able to setup the jQuery UI demo for drag and drop but unable to trigger the drag and drop using the trigger() method.
Can anyone help with setting this up?
My code so far is:
$(function() {
$( "#draggable" ).draggable();
$( "#droppable" ).droppable({
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "Dropped!" );
}
});
$('#draggable').trigger("drop", $('#droppable'));
});
Thanks in advance!
To make things simpler. All I want to be able to do is call the 'drop' method from anywhere outside of the droppable() but I will always need to be able to specify the event and ui objects.