0
我使用jQueryUI的,这是fiddle example。
我的问题是,你可以在我的小提琴看到,在resizable
DIV的文本行是相互重叠和我的div可以拖动只是一个时间。
我该如何解决这个问题?jQueryUI的可拖动和可调整大小的盒子问题
的Javascript
var DEF_HEIGHT = 100; // the #resizable default height
$("#resizable").resizable({
containment: 'parent',handles: "se",stop:resizeStop,
aspectRatio: true,
resize: function(event, ui) {
var curHeight = (ui.size.height/ DEF_HEIGHT) * 100;
$(this).css('font-size', curHeight + '%');
}
}).draggable({containment: 'parent', stop:dragStop});
function dragStop(event, ui){
convert_to_percentage($(this));
}
function resizeStop(event, ui){
convert_to_percentage($(this));
}
CSS
#container {
background:black;
position:relative;
margin:0;
line-height:0;
text-align:center;
}
#resizable {
width: 200px;
height: 100px;
padding: 10px;
font-size: 100%;
position:absolute !important;
}
问题是在convert_to_percentage如果你删除它会起作用,是否定义了这个函数?它没有在小提琴中定义,也许这是问题 – Reda