Question

Anyone know how we can disable "Snap to Grid" from jQuery UI Draggable base on checkbox.

I m using below code to enable snap to grid dynamically.

$(".WidgetCl").draggable({containment: '#editorWindow',scroll: true, snap: ".gridCol", snapMode: "both", stop :function() {$(this).trigger("stopdrag");}})
            $(".WidgetCl").draggable("option", "grid", [ gridSize, gridSize ]);

Thanks, Sonal

Was it helpful?

Solution

You have to set the grid option to false to disable snap-to-grid:

$(".WidgetCl").draggable("option", "grid", false);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top