Ich möchte mein # timebase1 div in drifher div verschieben. jetzt ist es nur der Anfang des div, ich möchte es überall in dragehere div einfügen.Mein Drag & Drop funktioniert nicht
function funct(e) {
var id = e.id;
mouseXY(id);
}
function mouseXY(id) {
//alert(id);
var x = event.pageX,
y = event.pageY
$('#' + id).css({
top: y,
left: x + ''
});
}
.activelevel1 {
background-color: #EA623E;
}
.timescalebase {
margin-top: 13px;
height: 7px;
position: relative;
width:0px;
}
<div id="draghere"style="width:100%;margin-top:25px;">
<div id="timebase1"draggable="true"class="timescalebase activelevel1" ondrag=funct(this)>
</div>
Wenn Sie jQuery Plugins try verwenden könnte [** abwerfbaren **] (https://jqueryui.com/droppable/) und [** ziehbare **] (https://jqueryui.com/draggable/) – Pugazh
warum hat dein html nicht Leerzeichen darin? ist es nur so? –