//用JQuery UI resizable(大小)、draggable(拖动) 获取image的坐标
$(function () {
$("#cutDiv").resizable({
aspectRatio: 1 / 1,
maxHeight: 180,
maxWidth: 180,
minHeight: 48,
minWidth: 48
}).draggable({ containment: 'parent' });
//获取要截取头像的坐标
$("#btnCut").click(function () {
//获取绝对坐标
var relTop = $("#cutDiv").offset().top - $("#leftContainer").offset().top;
var relLeft = $("#cutDiv").offset().left - $("#leftContainer").offset().left;
var width = $("#cutDiv").width();
var height = $("#cutDiv").height();
$.post("AjaxPhoto.ashx", { "action": "cutPhoto", "top": relTop, "left": relLeft, "width": width, "height": height, "imgSrc": data }, function (msg) {
$("#imgok").attr("src", msg); //设置img路径。
}, "text");
});
});