私はajaxから返されたライブdivをドラッグしようとしています。次のコードはデスクトップでうまく動作しますが、ipadではドラッグ可能なページをそれぞれ2回ドラッグしてドラッグしなければなりません。この1つをページの読み込みでさえも引き出すための助けとなるでしょうか?iquadのライブイベントでjqueryをドラッグ可能
HTML::
<div class="draggable"> drag this </div>
jqueryの:
$.fn.liveDraggable = function (opts)
{
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)))
{
this.live("touchstart", function() {
if (!$(this).data("init")) {
$(this).data("init", true).draggable(opts);
}
});
return $();
}
else
{
this.live("mouseover", function() {
if (!$(this).data("init")) {
$(this).data("init", true).draggable(opts);
}
});
return $();
}
};
$(".draggable").liveDraggable(
{
helper: 'clone',
containment: '#origin'
})