0
由於某種原因,我得到'ui.size'未定義的錯誤。這裏是我的代碼:ui.size在draggable中不工作()jquery-ui
$('.canvas').draggable({
containment: $('.canvas'),
refreshPositions: true,
drag: function(e, ui) {
area.css('border', 'none');
},
stop: function(event, ui){
var pinpointHeight, pinpointWidth, pinpointTop, pinpointLeft;
var offset = $('.canvas').offset();
for (var i = 0; i < image.pinpoints.length; i++) {
if(image.pinpoints[i].position == position){
pinpointHeight = image.pinpoints[i].height;
pinpointWidth = image.pinpoints[i].width;
}
}
var offset2 = area.children('#inner').offset();
myPinpoint = {
"top": offset2.top - offset.top-2,
"left": offset2.left - offset.left-2,
"width": ui.size.width,
"height": ui.size.height,
"position": position };
$.fn.mapImage.updatePinpoint(image, myPinpoint, position, (offset2.left - offset.left-2), (offset2.top - offset.top-2 + pinpointHeight));
//$.fn.pinpointImage.add(image, myPinpoint);
}
});