1
我是jQuery中的新成员。我正在尝试使用jcrop插件裁剪图片。
这里是我当前的代码:修复选择区域并停止jcrop中的新选择
jQuery(document).ready(function() {
var width = '<%=Session["imageWidth"]%>';
var height = '<%=Session["imageHeight"]%>';
jQuery('#imgCrop').Jcrop({
boxWidth: 800,
boxHeight: 600,
onSelect: storeCoords,
bgColor: 'pink',
bgOpacity: .6,
setSelect: [0, 0, width, height],
aspectRatio: 1
});
});
function storeCoords(c) {
jQuery('#X').val(c.x);
jQuery('#Y').val(c.y);
jQuery('#W').val(c.w);
jQuery('#H').val(c.h);
};
这里一切都很好,但在选择区域可以调整大小。
为了修复选择区域并停止新选择,应该更改哪些内容?
http://stackoverflow.com/questions/346045/jquery-jcrop-how-to-set-a-fixed-size-selection-area – agriboz 2013-02-14 11:19:20
的可能重复这真的很容易,看到这个答案我刚刚发布... http://stackoverflow.com/a/16688696/2152144 – WalterEgo 2013-05-22 09:56:27