있지만, 아직도 내가 그것을 좋아하는 방법과 작동하지 않습니다 :
가장 좋은 방법은 콜백와 함께 할 것입니다.
var dragCatch = function(event, ui) {
var containerOffset = $('#container').offset().top;
var containerBottom = containerOffset + $('#container').height();
var componentHeight = $(this).height();
if (event.pageY > containerBottom - componentHeight - 2) {
$('#container').height(event.pageY - containerOffset + componentHeight + 2);
$(this).css('top', event.pageY - containerOffset);
}
};
$(this).each(function() {
$(this).draggable({
grid: [117,1]
,snap: '.draggable'
,snapMode: 'outer'
,containment: '#container'
,drag: dragCatch
})
});
이 코드는 성공적으로 #container div의 크기를 조정하지만, #container 종료하는 데 사용되는 .draggable 사업부를 이동 중지 :
는 여기에 내가 지금은 부분적으로 작업 (위의 마크 업을 사용)이 방법은 다음과 같습니다. 나가면 놓은 다음 다시 드래그하면 .draggable이 #container가 끝나는 위치로 다시 이동하고 #container가 계속 확장되는 경우에도 멈 춥니 다.
단순히 콘텐츠를 삭제해도 작동하지 않습니까? '#container {overflow : auto}' –