Giter Site home page Giter Site logo

determine lowset zoom about jquery-cropbox HOT 5 CLOSED

acornejo avatar acornejo commented on June 27, 2024
determine lowset zoom

from jquery-cropbox.

Comments (5)

bharatpatil avatar bharatpatil commented on June 27, 2024

actually I wanted to execute a code to fit complete image inside crop area upon on lowest possible zoom

from jquery-cropbox.

acornejo avatar acornejo commented on June 27, 2024

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);
});

from jquery-cropbox.

bharatpatil avatar bharatpatil commented on June 27, 2024

Wow!! Thanks for such a nice plugin.
Sorry for my wrong question, my question should have been how to identify when I am zooming out if I am on lowest zoom. Once I am on lowest zoom inside zoomout function and again user tries to zoom out 2nd time I wanted to fit image inside cropbox viewport.

I hope you got my question..!!

from jquery-cropbox.

acornejo avatar acornejo commented on June 27, 2024

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.

from jquery-cropbox.

bharatpatil avatar bharatpatil commented on June 27, 2024

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.

from jquery-cropbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.