desandro / draggabilly

:point_down: Make that shiz draggable
https://draggabilly.desandro.com
MIT License
3.86k stars 386 forks source link

Allows containment to be restricted to a single axis #123

Closed charliekassel closed 6 years ago

charliekassel commented 8 years ago

My use case a gantt chart where I'd like the ability to drag outside the container on the x-axis but to be contained on the y-axis. Maybe an edge case but this PR allows containment restriction to be applied to a single axis.

Example usage:

var draggie = new Draggabilly(document.querySelector('.draggable-element'), {
   containment: document.querySelector('.wrapper-element'),
   containmentAxis: 'y'
});
desandro commented 8 years ago

Thank you for this contribution! This is a nice little addition. Like you said, it may be an edge case. I'll keep the PR open for a while in case others are interested

+1 or add a :+1: reaction to this issue if you'd like to see this PR merged.

desandro commented 6 years ago

I've decided to pass on this request. Thanks again for your contribution!