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

Zoom and update methods ? #53

Open
Rqsb opened this issue Aug 28, 2014 · 1 comment
Open

Zoom and update methods ? #53

Rqsb opened this issue Aug 28, 2014 · 1 comment

Comments

@Rqsb
Copy link

Rqsb commented Aug 28, 2014

Hello,

I've been trying to use your zoom() and update() methods in a code snippet but so far it doesn't do anything. What did I get wrong ?

Here's the code snippet I used

$(function () {
    var r = $('#results'),
        x = $('.cropX', r),
        y = $('.cropY', r),
        w = $('.cropW', r),
        h = $('.cropH', r);
    $('#cropimage').cropbox({
        width: 200,
        height: 200
    }).on('cropbox', function (event, results, img) {
        x.text(results.cropX);
        y.text(results.cropY);
        w.text(results.cropW);
        h.text(results.cropH);
    });
    crop = $('#cropimage').data('cropbox');
    crop.zoom(1); // or zoom(0);
    crop.update();
});

Thanks !

@Quji
Copy link
Contributor

Quji commented Sep 5, 2014

There is no onLoad method for now, so u have 2 options:

setTimeout(function() {
    crop = $('#cropimage').data('cropbox');
    crop.zoom(1); // or zoom(0);
    crop.update();
}, 100);

or use one of pull requests: #56, #51

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

2 participants