【发布时间】:2015-04-21 10:50:34
【问题描述】:
我创建了一个使用 cropper.js 来裁剪图像的应用程序,该应用程序正在运行并且图像正在生成,但我无法裁剪图像。我的代码如下所示
谁能告诉我一些解决方法
html
<div class="container">
<img src="http://fengyuanchen.github.io/cropper/img/picture.jpg" />
</div>
脚本
$('.container > img').cropper({
aspectRatio: 16 / 9,
crop: function(data) {
// Output the result data for cropping image.
}
});
【问题讨论】:
-
你不需要设置
aspectRatio吗? -
是强制性的,我们如何设置它
-
根据您链接到的 github 存储库中给出的示例
-
@atmd 好的,我已经更新了,添加了纵横比,仍然无法正常工作