user6538837 user6538837 - 1 year ago 67
Javascript Question

Is there a way to limit the area which can be dragged?

As you can see in this JSFiddle, I have a box which I can drag throughout the body. However, is it possible to only be allowed to drag it when the user selects the purple part with an id of head?

$( "#box" ).draggable({containment: "#container"});

Answer Source

Use handle

$( ".selector" ).draggable({
  handle: "#head"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download