出于某种原因,当我尝试调整它时,resizable div
会变小;
我没有为这个元素设置任何属性;
要在可调整大小的事件上执行的代码:
$(".dragbox").resizable({
grid: [10, 10],
containment: 'parent',
reflow: true,
start: function(event, ui) {
var id = ui.helper.context.id.split('_')[1];
console.log(id);
console.log('start ui size width: ' + ui.size.width);
},
stop: function(event, ui) {
console.log('stop ui size width: ' + ui.size.width);
//do not update the widgets pos/size not even by accident when we are in forced rearrange mode
if (jQuery('#widget_content').hasClass('floating-dashboard-widgets'))
return false;
var id = ui.helper.context.id.split('_')[1];
//console.log(id);
$.ajax({
type: "POST",
url: "<?php echo Yii::app()->baseUrl . '/user/dbview/update/id/'; ?>" + id,
data: {data: {width: ui.size.width, height: ui.size.height, parent_width: get_parent_width(), parent_height: get_parent_height()}},
success: function(data) {
// console.log(data);
if (data.status == true) {
ui.size.width = data.info.width;
}
},
dataType: 'json',
});
}
});
答案 0 :(得分:1)
您的可调整大小的div似乎有一个填充。
删除它(可能将其移动到子元素)可能会修复它。 :)