jquery ui ddraggable : limit dragable area by pixels
问题 I have an Image and I want to allow users to drag the image only in Y axis and I have to limit the dragging by pixels, which means users can drag only 200 pixels in Y axis (either upside and downside) <script> $(function() { $( "#img" ).draggable({ axis: "y" }); }); </script> I could limit the dragging in Y axis only but I didn't see an option to limit the dragging in pixels. please help 回答1: There is also the option 'containment' where you can specify a bounding box with coordinates (among