clone()
jQueryのヘルプが必要です。
つまり、これは次のとおりです。タッチデバイスで動作するある種のドラッグ&ドロップ&ソートを行っています。要素を複製すると、イベントがなくなることを除いて、すべてが良好です(ドラッグが機能しなくなります)。
コードは次のようになります (簡略化されています)。
$('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
});
});
私は何を間違っていますか?
ありがとう!