$(function () { $('.switch-button, .switch-grip').on('click', function() { $(this).parents('.pedal').toggleClass('active'); }); var rotationSnap = 30; Draggable.create(".knob", { type:"rotation", throwProps:true, snap:function(endValue) { return Math.round(endValue / rotationSnap) * rotationSnap; } }); });