-
Notifications
You must be signed in to change notification settings - Fork 83
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
determine lowset zoom #9
Comments
actually I wanted to execute a code to fit complete image inside crop area upon on lowest possible zoom |
Yes, the property minPercent of the cropbox data (I will document this). So you would do: $('yourimage').data('cropbox').minPercent This property will only be populated AFTER the image has been loaded by the browser (otherwise it can't be computed). Therefore I suggest you query for the property inside the the cropbox event, like this: $('yourimage').on('cropbox', function (event, result, cropbox) {
console.log('lowest zoom is ' + cropbox.minPercent);
}); |
Wow!! Thanks for such a nice plugin. I hope you got my question..!! |
I don't think I understand you. The image should always be "fit" inside the cropbox viewport. If you want to zoom out beyond the boundaries of the image (i.e. you want part of the cropbox to have empty space), then this is unsupported by this plugin. You are welcome to submit a pull request implementing this feature, but it should be optional since most people don't want that behavior. |
Yes you are correct but I have such a requirement then I will be setting image width:auto / 100% and height:auto / 100% depending upon the image ratio. |
Is there any way to identify that we are on lowest possible zoom so that I can execute another function?
The text was updated successfully, but these errors were encountered: