I am trying to drag and drag a 'drag' manually without contacting a mouse / user .
So far I have been able to set up the jQuery UI for drag and drop but using the trigger () method has been unable to trigger drag and drop.
Can someone help set this up?
My code is so far:
$ (function () {$ ("#draggable"). Draggable (); $ ("#droppable") .droppable ("$ - draggable"); $ (this) .addClass ("UI-state-highlights") .Find ("p") .html ("dropped!");}}}; $ (' ). Triggers ("Drop", $ ('# droppable'))} Thanks in advance!
Easing things Whatever I want to be able to do, it calls the 'drop' method anywhere out of droppable (), but I will always need to specify event and UI objects.
Why not trigger the trigger by creating a custom context? Then you can trigger it yourself:
$ (function $$ ("#draggable"). Draggable (); $ ("#droppable") .Droppable ({drop: function (Event, UI) {$ (this). Trigger ("custom event", UI);} $ ("Dropped!"); $ ("Drop Drop!"); $ ("Custom Event", Function (Event, UI) {$ (this). "#droppable"). Triggers ("customEvent", $ ("#draggable"))};
Comments
Post a Comment