ちょっとした質問です。Jcropbox の画像が完全に読み込まれたかどうかを確認するにはどうすればよいですか? 私はJavaScriptの初心者なので、誰かが助けてくれると本当に感謝しています. これが私のコードです。
jQuery(document).ready(function () {
jQuery('#<%= imgPerson.ClientID %>').Jcrop({
onChange: showPreview,
onSelect: updateCoords,
aspectRatio: 1,
minSize: [60, 60],
setSelect: [1, 1, 60, 60],
allowSelect: false
});
});
function updateCoords(c) {
jQuery('#<%= X.ClientID %>').val(c.x);
jQuery('#<%= Y.ClientID %>').val(c.y);
jQuery('#<%= W.ClientID %>').val(c.w);
jQuery('#<%= H.ClientID %>').val(c.h);
};
function showPreview(coords) {
var height = '<%= hdnimgHeight.ClientID %>';
var height2 = $(height).value;
var rx = 60 / coords.w;
var ry = 60 / coords.h;
$('#<%= imgPreview.ClientID %>').css({
width: Math.round(rx * 400) + 'px',
height: Math.round(ry * height2) + 'px',
marginLeft: '-' + Math.round(rx * coords.x) + 'px',
marginTop: '-' + Math.round(ry * coords.y) + 'px'
});
};