scrip.taculo.us Draggables
December 19, 2007 11:00 AM   Subscribe

JavaScript:— I want to call a function to make a scrip.taculo.us Draggable revert (fly back to its starting position). This is easy to do if you want it to revert when it is released from the drag, but I want it to happen when a different Draggable is released from a drag.

During a survey, the user is presented with 5 big boxes (Droppables) labeled with subjects, and 5 small boxes (Draggables) labelled "1st", "2nd" etc. The user drags the ranks to the big boxes to rank the subjects in importance. When the user drags a rank into a box that already has a rank in it, I want the rank Draggable that is already there to revert back to its starting position.

There may be better UI ways of doing this whole thing. A Sortable list is an obvious solution, but we need to distinguish between a user who has accepted the default ranking order that was given to them, and a user who has just ignored the question. A "confirm my answer" button would be kinda lame, because none of our other questions require more than one submission button to be clicked, and it might confuse the user. Other suggestions would be great.
posted by East Manitoba Regional Junior Kabaddi Champion '94 to Computers & Internet (2 answers total) 1 user marked this as a favorite
 
Best answer: It's ok, I got it.

myRankBox.options.reverteffect(document.getElementById(myRankBox.id),myRankBox.currentDelta()[1],myRankBox.currentDelta()[0]);

THX GUYZ
posted by East Manitoba Regional Junior Kabaddi Champion '94 at 12:21 PM on December 19, 2007


As long we're being so helpful, you could also use $(myRankBox.id) instead of document.getElementById(myRankBox.id). Or, for that matter, just myRankBox.
posted by ook at 2:21 PM on December 19, 2007


« Older Pimp my GUI!   |   Where exactly did my ancestors disembark in New... Newer »
This thread is closed to new comments.