scottcheng / cropit

A "customizable crop and zoom" jQuery plugin.
http://scottcheng.github.io/cropit/
MIT License
874 stars 307 forks source link

Initial Image Load Issue #250

Open trstaley opened 7 years ago

trstaley commented 7 years ago

My code is below and I have tried several different methods for passing in an initial image. Thus far anything I do, displays the initial image, but then any image selected from the file input refuses to display. Any help would be greatly appreciated.

<form action='#'>
        <div class='image-cropper'>
            <input type='file' class='cropit-image-input' accept='image/*'>
            <div class='cropit-preview'>
                <div class='cropit-box'>
                    <canvas width='150' height='150' id='canvas'></canvas>  
                </div>
            </div>
            <input type='range' class='cropit-image-zoom-input'>
            <input type='hidden' name='image-data' class='hidden-image-data' />
       </div>
</form>

    <script>
        $(document).ready(function() {
            $('.image-cropper').cropit({
                smallImage: 'allow'
            });
        });
    </script>