에 드래그 jQuery를 UI 나는이 http://jqueryui.com/demos/droppable/작은 낙하 할
을 사용하고 있습니다하지만이 문제를 드래그보다 작은 낙하 할에 끌어 있습니다.
droppable에는 드롭되지 않지만 droppable의 왼쪽 위에 나타납니다.
alt text http://yart.com.au/junk/draggableProblem.jpg
이 주변에 어떤 방법이 있나요?
다음은 코드입니다. 감사합니다.
$('.draggable').draggable({
revert: 'invalid',
revertDuration: 500,
appendTo: 'body',
helper: function(event, ui) {
return $(this).clone().appendTo('body').css('zIndex', 5).show();
},
drag: function(event, ui) {
$(ui.helper).removeClass("enlarge");
$(ui.helper).addClass("thumbnail");
$(this).hide();
},
stop: function(event, ui) {
$(this).show();
//$(this).addClass("enlarge");
if ($(this).parent().hasClass("imageContainer")) {
$(this).addClass("thumbnail");
}
else {
$(this).addClass("enlarge");
}
},
//cursorAt: { top: 30, left: 40 },
delay: 100,
refreshPositions: true
});
$('.imageContainer').droppable({
accept: '.draggable',
drop: function(event, ui) {
ui.draggable.css({
"position": "relative",
"left": "0px",
"top": "0px"
});
if ($(this).children().length == 0) {
// ui.draggable.addClass("thumbnail");
$(ui.draggable).appendTo(this);
$(this).removeClass("border");
}
},
over: function(event, ui) {
ui.draggable.removeClass("enlarge");
ui.draggable.addClass("thumbnail");
$(this).addClass("border");
},
out: function(event, ui) {
// ui.draggable.removeClass("zoomIn")
$(this).removeClass("border");
},
tolerance: 'intersect'
});
CSS :
.thumbnail {
height:60px;
margin-right:10px;
width:80px;
z-index:1;
}
.enlarge {
border:5px solid white;
height:145px;
width:195px;
}
draggable 및 droppable에 대한 jquery 코드를 표시 할 수 있습니까? 나는 알고 있다고 생각하지만 대답은 내 마음 속으로 뛰어 오르지 않는다. – jcolebrand
코드를 추가했습니다. 감사합니다. drachenstern – Aximili
죄송합니다.이 글을 다시 읽지 못해 죄송합니다. 조금만 살펴보고 내가 도울 수 있는지 알아 보겠습니다. - 확대를 위해 CSS를 게시 할 수 있습니까? 및 미리보기 이미지? - 수업을 ui.helper에서 draluable로 혼자두면 어떻게됩니까? 예상대로 떨어지는가? (크기는 크더라도?) – jcolebrand