1
내가 드래그 할 수있는 요소를 삭제할 때 작은 문제가, 시도 사용 jQuery를 UI 드래그 & 드롭은, 그것은 ... 오른쪽 하단 모서리에, 멀리 멀리도하지 난 창을 가고있어jQuery를 UI 드래그 앤 드롭 요소 점프
$(function() {
var $gameBox = $(".gameBox"),
$newElemWrapper = $(".newElemWrapper"),
$trash = $(".trash"),
$list = $(".sortElements"),
$newElem = null,
colors = ["red", "limeGreen", "crimson", "white", "yellow"],
randNum = function() {
return Math.floor(Math.random() * colors.length);
},
$addElem = function() {
$newElem = $("<li></li>")
.addClass("newElem")
.css("display", "none")
.css("background-color", colors[randNum()])
.appendTo($newElemWrapper)
.fadeIn();
return $newElem;
},
$moveElem = function($elem) {
$elem.fadeOut(function() {
$elem.appendTo($list).fadeIn();
});
};
(function go() {
$addElem().draggable({
revert: "invalid",
containment: $gameBox,
stack: $trash
});
$trash.droppable({
accept: $(".newElemWrapper > li"),
drop: function(evt, ui) {
$moveElem(ui.draggable);
setTimeout(go, 500);
}
});
}());
});
누군가가 도움을 주시면 매우 감사드립니다. 내가 잘못
! 정말 고맙습니다! – vanless
@vaniaDrach 감사합니다. so much so SO – gaetanoM
done) thanks again =) – vanless