I use a plugin plugin, it works fine, but does anyone know how to put a few preliminary images of images and export them correctly without performing several functions? Below is a demo for the plugin, and here is the code:
$('#image-cropper').cropit();
$('.download-btn').click(function() {
var imageData = $('#image-cropper').cropit('export');
window.open(imageData);
});
.cropit-preview {
width: 960px;
height: 540px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="image-cropper">
<div class="cropit-preview"></div>
<input type="range" class="cropit-image-zoom-input" />
<input type="file" class="cropit-image-input" />
</div>
<div id="image-cropper">
<div class="cropit-preview"></div>
<input type="range" class="cropit-image-zoom-input" />
<input type="file" class="cropit-image-input" />
</div>
Run codeHide result
source
share