这是cropper的演示页面:https://fengyuanchen.github.i...
我想使用旋转按钮,就是下面红框中的两个:
按照文档操作https://github.com/fengyuanch...
<div class="btn-group" role="group" aria-label="Basic example">
<button id="rotateLeft" type="button" class="btn btn-secondary" data-method="rotate" data-option="-90" title="左转">
<i class="fa fa-undo" aria-hidden="true">左转90度</i>
</button>
<button id="rotateRight" type="button" class="btn btn-secondary" data-method="rotate" data-option="90" title="右转">
<i class="fa fa-repeat" aria-hidden="true">右转90度</i>
</button>
</div>
$("#rotateLeft").cropper('rotate', -90); $("#rotateRight").cropper('rotate', 90);
可是不能使用,浏览器提示Cannot read property 'rotate' of undefined
看了一下js源代码: https://fengyuanchen.github.i...
没看懂是怎么触发按钮的,请大神帮讲一下过程。
相关分类