cropper.js 遇到问题
Having trouble with cropper.js
我正在使用 cropper.js 做我正在做的事情,但在让它正常工作时遇到了一些麻烦,是否可以看看我可能做错了什么。
网页上的图像"duplicates"。 (此处使用随机图片为例)
我的Html,图片:
<img id="ImageFrame" src="http://www.availstaffing.com/wp-content/uploads/2010/07/Temporary-Button.jpg" style="max-width:100%" />
我的javascript:
$(function () {
var image = $('#ImageFrame');
var cropImage = new Cropper(image[0], {
preview: 'div#CropPreview',
built: function () {},
crop: function (e) {
$("#cropX").val(Math.round(e.detail.x).toString());
$("#cropY").val(Math.round(e.detail.y).toString());
$("#cropH").val(Math.round(e.detail.height).toString());
$("#cropW").val(Math.round(e.detail.width).toString());
}
});
});
那么结果:
欢迎任何帮助。
尝试将 cropper.css 添加到您的文件中
我正在使用 cropper.js 做我正在做的事情,但在让它正常工作时遇到了一些麻烦,是否可以看看我可能做错了什么。
网页上的图像"duplicates"。 (此处使用随机图片为例)
我的Html,图片:
<img id="ImageFrame" src="http://www.availstaffing.com/wp-content/uploads/2010/07/Temporary-Button.jpg" style="max-width:100%" />
我的javascript:
$(function () {
var image = $('#ImageFrame');
var cropImage = new Cropper(image[0], {
preview: 'div#CropPreview',
built: function () {},
crop: function (e) {
$("#cropX").val(Math.round(e.detail.x).toString());
$("#cropY").val(Math.round(e.detail.y).toString());
$("#cropH").val(Math.round(e.detail.height).toString());
$("#cropW").val(Math.round(e.detail.width).toString());
}
});
});
那么结果:
欢迎任何帮助。
尝试将 cropper.css 添加到您的文件中