I am editing a Tower of Hanoi game, where a user can drag discs from one peg to another peg.
The plugin I found is using jQuery UI draggable/dropable to accomplish this. I want to edit the plugin to implement functionality where the user has to first drag up (Y axis) a certain number of pixels before they are then able to drag left/right/up/down without any constraints.
Is there any way to require the user to first drag up 100 pixels before allowing the user to drag anywhere within the container?
Below is the code where I bind the draggable functionality to the disc (as well as record the coordinates of thr drag into local storage), in case it helps.
discObj.getDisc().draggable({
revert: 'invalid',
containment: this.container,
cursor: 'move',
disabled: true,
helper: 'clone',
scroll: false,
drag: function(event, ui) {
var pos = ui.position;
var numPos = localStorage.getItem('numStepPositions');
var coordinates = 'disc:' + discID + ';left:' + pos.left + ';top:' + pos.top +';';
localStorage.setItem('position' + numPos, coordinates);
numPos++;
localStorage.setItem('numStepPositions', numPos);
}
});