JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://scottcheng.github.io/cropit/scripts/vendor.js"></script>
<div id="image-cropper" style="direction: ltr">
<div class="row margin-top-25">
<div class="col-md-8 col-md-offset-2">
<div class="cropit-image-preview-container">
<div class="cropit-image-preview"></div>
</div>
</div>
</div>
<div class="row margin-top-15">
<div class="col-md-4 col-md-offset-4">
<input type="range" class="cropit-image-zoom-input" />
</div>
</div>
<div class="row margin-top-15">
<div class="col-md-4 col-md-offset-4">
<input type="file" style="display: none" class="cropit-image-input" />
<div class="R_butt_blue choose_pic text-center">Select image</div>
<div class="send_image">Get Cropped image.</div>
</div>
</div>
</div>
CSS
.cropit-image-preview {
/* You can specify preview size in CSS */
width: 100px;
height: 100px;
}
JavaScript
$('.choose_pic').click(function(){
$('.cropit-image-input').click();
});
var z = $('#image-cropper');
z.cropit({
exportZoom: 1,
imageBackground: true,
imageBackgroundBorderWidth: 15 // Width of background border
});
$('.send_image').click(function(){
var h = z.cropit('export');
alert(h);
$('#photo_show img').attr({ src: h });
});