jQuery's draggable grid

Since @Pez's answer is lost (404), here's how I did it:

$('#elem').draggable({
    ....,
    drag: function(e, ui) {
        ui.position.left = Math.floor(ui.position.left / 10) * 10;
        ui.position.top = Math.floor(ui.position.top / 10) * 10;
    }
});

Demo: http://jsfiddle.net/ThiefMaster/yGsSE/


I got around this problem by simply adding my own script to drag: under draggable and setting it to

divide math.Floor(x/100)*100 

and the same for Y.