图像的另一部分我有一个问题,这个插件jQuery的图像裁剪的问题 - 显示出比选择
http://odyniec.net/projects/imgareaselect/
我觉得图片说明这一切。
我已经选择了整个图像,但拇指只显示其中的一部分。 即使在更大的图像上,它确实显得很糟糕。我的代码
function preview(img, selection) {
if (!selection.width || !selection.height)
return;
var scaleX = 100/selection.width;
var scaleY = 100/selection.height;
$('#preview img').css({
width: Math.round(scaleX * 300),
height: Math.round(scaleY * 300),
marginLeft: -Math.round(scaleX * selection.x1),
marginTop: -Math.round(scaleY * selection.y1)
});
}
$(function() {
$('#photo').imgAreaSelect({ aspectRatio: '1:1', handles: true,
fadeSpeed: 200, onSelectChange: preview });
});
我试图jcrop但它同样
我需要看到标记为“#preview img”来诊断问题 –