0
나는 끌어서 놓을 수있는 항목 목록을 작성하려고합니다.자녀를 부모로 끌어다 놓고 여전히 자녀에게 액세스하십시오.
요소를 상위 요소로 놓고 새로 이동 된 요소에 하위 요소를 놓으려면 성공합니다.
하지만 내가 할 수없는 일은 "액세스하는"것입니다. 예를 들어 li 요소를 두 번 클릭하면 해당 요소 이름의 상자가 열립니다. 그럴 수는 없지만 항상 이벤트를 시작하는 것은 부모입니다.
나는 zIndex로 게임을 시도했지만 해결책은 아닙니다.
내 피들을보다 명확하게 봅니다. http://jsfiddle.net/WeeHT/
감사합니다.
function make_draggable() {
$('.account_line').draggable({
containment: '#COA_Table',
cursor: 'move',
snap: '#COA_Table',
helper: 'clone'
})
}
function make_droppable() {
$('.account_line').droppable({
accept: '.account_line',
tolerance: 'pointer',
hoverClass: "account_line_drop-hover",
zIndex: zindexlevel++,
drop: function (e, ui) {
// if this is first child we append a new ul
if ($(this).children('ul').length == 0) {
$(this).append('<ul></ul>')
}
$(this).children('ul').append(ui.draggable)
$(this).css({
backgroundColor: 'white'
})
$(this).css({
zIndex: zindexlevel++
})
},
over: function() {
$(this).css({
backgroundColor: "grey"
});
},
out: function() {
$(this).css({
backgroundColor: 'white'
})
}
})
}
대단히 감사합니다. 알아두면 아주 편리합니다. 한 가지 더 궁금한 점이 있습니다. 나는 지나치는 선을 칠하는 것과 관련해서도 똑같은 문제가 있습니다. 부모님은 내가 자녀를 다룰 때 착색되어 있습니다. e.stopPropagation()을 배치하려고했지만 물론 .droppable()을 잘라 내기 때문에 작동하지 않습니다. 어디에서 배치할까요, 어떻게 처리할까요? – Eagle1