-
Notifications
You must be signed in to change notification settings - Fork 296
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
How to set bounds params #33
Comments
The property in config you're looking for is I was able to lock my panzoom element to the container like this:
Edit: Bounds configuration apply for both panning and zooming. With this configuration you won't be able to zoom at all - which is definitely not the desired outcome for me. :/ Is there any way, how to set bounds only for panning (not for zooming)? |
bump Would love to know how to properly set bounds as well 👍 |
With my PR it can be achieved with options below:
|
Thanks, I will try it out |
Is there the way to add bounds for zoomed picture? |
Just thought I'd share my workaround for this, I played around with setting the bounds but wasn't able to maintain zooming behaviour + bounds. The main issue for me was that I was able to prevent panning past the left edge but not the right. I ended up using:
Then added some functionality on the "panend" event to "snap" back to the right edge when panning past it.
Still not really ideal, I also tried using the .pause() and .resume() functions in the same scenario but it seems .resume() doesn't restore all previous functionality. |
Related? #105 |
Currently, the source code needs modification to perform your expected functionality. I've opened a PR for this issue. Take a look into #105 . This example shows panzoom bounded to its parent container using my panzoom branch: https://codepen.io/rbonomo/pen/BexEPR |
Hi:
There doesn't seem to be any documentation on how to set a bounding conatiner for the panning.
I would love to just have it pan within the parent element. Is there a way to do this?
I tried to look through the library. This is what I guessed would be the way set the bounds, but it didn't work
bound: {
top:0,
bottom:100,
left:100,
right:100,
}
This would be very helpful if you could inform me.
Thanks!
The text was updated successfully, but these errors were encountered: