fengyuanchen / cropper

⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-cropper
MIT License
7.75k stars 1.74k forks source link

Why can't get canvas element #893

Closed FerdinandRay closed 7 years ago

FerdinandRay commented 7 years ago

js code here.

        $('#confirm').on('click', function(e) {
            var $this = $(this);
            var data = $this.data();
            var result;
            data = $.extend({}, data);

            result = $image.cropper(data.method, data.option, data.secondOption);

            $('#imageModal').modal().find('.modal-body').html(result);

            $download.attr('href', result.toDataURL('image/jpeg'));
        })

when i debug the getCroppedCanvas method at your demo page http://fengyuanchen.github.io/cropper/

i found you get the canvas element for result variable. but i got this. like the pic.

Alt text

how could i get the canvas. other code is just like your demo

jquery version is 3.2.1 cropper version is 3.0.0-rc.1(jquery version)

thanx

FerdinandRay commented 7 years ago

don't know why. but it's ok now ....