1
jQuery에서 clone()
과 관련하여 도움이 필요합니다.jQuery로 touchevent를 복제하는 방법은 무엇입니까?
그럼,이게 뭔가요 : 나는 터치 장치에서 작동 할 & 방울 & 정렬을하고 있습니다. 요소를 복제 할 때 이벤트가 사라지는 것을 제외하고는 모든 것이 좋습니다 (드래그가 작동하지 않습니다).
$('li', layers).each(function(){
this.addEventListener('touchend', function(e){
var cloned = $(this).clone(true, true); // no events are cloned at all!
cloned.insertBefore(this.helper);
}); //ontouchend
this.addEventListener('touchmove', function(e){
// do some stuff with this.helper
});
});
내가 잘못 어떻게해야합니까 : (간체 이상)과 같이
코드가 보인다?
감사합니다.
당신은 또한 touchend''에서 원본을 제거 마십시오 예컨대 : 할 수 있을까? 그렇다면'this.insertBefore (...)'를 시도해보십시오. 자동으로 이동됩니다. – pimvdb
와우! 그게 효과가있어! 감사합니다. 올바른 답변으로 표시하기 위해 댓글이 아닌 게시물로 추가 할 수 있습니까? 감사! –
건배, 처음에 문제가 해결 될지 확실하지 않았습니다. – pimvdb