this is the code:
$("#draggable").draggable({
helper: 'clone'
});
use this code , if you drag the div , you will drag the clone ,
this is my code without using jquery and jquery-ui,i want to drag the clone-one when i drag the div:
var $=function(str){
var div=document.createElement('div')
div.innerHTML=str;
return div.firstChild;
}
function id(id){
return document.getElementById(id)
}
and
id('draggable').addEventListener("touchstart", function(e) {
var clone_div=$('<div id="draggable_" style="z-index:11;color:red">'+
'<p>Drag me to my target</p>'+
'</div>')
clone_div.addEventListener("touchstart",function(e2){
e2=e;
})
});
and
id('draggable').addEventListener("touchmove", function(e) {
//if(e.changedTouches[0].target == id('draggable')){
e.preventDefault();
id('draggable').dragging=true;
//var orig = e.originalEvent;
var x = e.changedTouches[0].pageX;
var y = e.changedTouches[0].pageY;
id('draggable').style.left=x-70+'px';
id('draggable').style.top=y-70+'px';
});
what can i do ?
thanks