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

Était-ce utile?

La solution

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

$(".WidgetCl").draggable("option", "grid", false);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top