Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constrain to parent #19

Closed
onigetoc opened this issue Dec 24, 2013 · 3 comments
Closed

Constrain to parent #19

onigetoc opened this issue Dec 24, 2013 · 3 comments

Comments

@onigetoc
Copy link

Your plugin is exactly what i was looking for,
It miss only a thing it's to constrain the drag to the parent div.

And then it would be perfect for me.

@foxbunny
Copy link

@onigetoc You can just use Math.max and Math.min to add coordinate constants yourself. It should be trivial.

@stephband
Copy link
Owner

What @foxbunny says. On movestart, measure the offset, width and height of the parent, then use that to constrain the positioning of the thing you're moving.

This isn't supposed to be a plugin with lots of options, it's an event you can use to make a plugin with options if you so wish.

@onigetoc
Copy link
Author

Ok, thank you, i will try this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants